View Single Post
  #2 (permalink)  
Old September 6th, 2006, 03:08 AM
Ankur_Verma Ankur_Verma is offline
Friend of Wrox
Join Date: Jun 2003
Location: , , .
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma

Surely, with what you have, casting wont work the way you
have proposed here. But what you can do is to write all the
conversion/traversal logic in a member function or an operator
overload in one of these collection classes or in a common function
which does the conversion whenever its needed.

I would add though, that there are better ways of implementing
collections. You could have based these collection classes on
collection and enumeration interfaces, which makes traversal
easy. It would have also helped you in keeping the things cleaner
and casting issues would be much easier to manage as the collection
would all have a common base.

Reply With Quote