Re: [libxml++] _private field



On Fri, 2003-02-07 at 00:07, Christophe de Vienne wrote:
> Good evening,
> 
> I have a small doubt :
> 
> Initialising the _private field of xmlNode structures is done this way (for 
> element in the exemple) :
> 
> node->_private = new xmlpp::Element(node);
> 
> so the xmlpp::Element pointer is stored in a void *.
> 
> when reading it in destruct, the _private field is cast to a Node * for 
> deletion.
> 
> At _private initialisation, shouldn't the pointer cast to Node * before being 
> cast to void *, since we have some virtual functions ?

Why isn't an implicit conversion from Element* to Node* OK?

> Or would it be the case only if Element herit virtualy from Node ?

Yes. I think so.

-- 
Murray Cumming
murray usa net
www.murrayc.com





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