J.Pietschmann wrote:

> appropriate cast.  Unfortunately, in the maintenance branch
> the children vector is protected and directly accessed in a
> lot of places, putting the test+cast code and the handling
> of the one-child-only special case everywhere seemed to be
> too much work. Writing a custom iterator for the children
> list would solve this, but I *hate* writing custom iterators.
> (It is harder than many people think to get it both correct
> and efficient)
I agree with you, but this one seems to be simple and would benefit by 
decoupling fo tree internal structure and its usage. Usual design pattern 
could be used - hierarcy of custom iterators: EmptyIterator, 
SingleItemIterator and ArrayIterator. I'm not aware actually whether iterators 
are suitable here at all, do we need random access to children?

Oleg Tkachenko
Multiconn International, Israel

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

Reply via email to