Hi,
        I think it must have been me who has been unclear :). I am not
asking the type to enforce its own constness. If you want a const iterator
then you ask for one from the Document. This returns a completely
different class with const methods that return const DOMNodes and it has
(in the case of DOMTreeWalker) a private member root who's type is const
DOMNode *.

Does that make sense?

Gareth


> Yes, I think I must have been unclear.  My only point was that a class
> cannot enforce constness via its own type (in your example
> ConstDomTreeWalker), because the enforcement mechanisms are different.  Your
> way requires runtime type resolution at best, and even then can be
> circumvented without casting, whereas the only way to circumvent the const
> keyword is via a compile-time cast.
> 
> I do agree that fixing the const correctness would be a good thing, I just
> don't think the way you proposed will work, Erik Rydgren however provided a
> solution which I do think is workable.
> 
> Brad
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
Gareth Reakes, Head of Product Development  +44-1865-203192
DecisionSoft Limited                        http://www.decisionsoft.com
XML Development and Services




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to