RE: [Re: [Re: [Re: [Re: [libxml++] UTF8 support]]]]



> > > > More importantly, I'm not sure whether our 
> > > > inheritance/polymorphism
> > > > would still work. Is Element<Glib::ustring> still an 
> instance of 
> > > > Node<Glib::ustring>?
> > > 
> > > yes:
> > 
> > Sorry, bad example. Yes, is probably would work for simple 
> typedefs, 
> > but I don't think it would work for derived classes, such as your 
> > pimpl technique.
> 
> Should do:
> 
> class Node {
>     void* pimpl;  // points at a Node<s>
> };
> 
> class Element : public Node {
>     void* pimpl;  // points at an Element<s> which has a 
> Node<s> base };

Yes, you could implement the same inheritance hierarchy again, because,
unlike a smartpointer, you know about the inheritance of the implementation
classes. But I think that Xerces-C++ did this too. I wonder why
dynamic_cast<> wasn't possible with Xerces-C++ when they used this
technique. It's not important, I think, unless we do this, and I don't think
I will.

> P.S. I've attached a tarball with a demo of this technique. 
> Un-tar and type "make" (or "gmake" on non-GNU systems)

I think I already know how it works and that it's problematic.

Murray Cumming
murrayc usa net
www.murrayc.com 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]