[C++-sig] Iterators for heterogeneous container

2009-11-05 Thread Thomas Daniel
I am having trouble wrapping a container that can hold multiple object types and therefore has multiple iterator types. My C++ library has these classes: class Tomato; class Potato; class Garden { Iter get_tomatoes(); Iter get_potatoes(); }; template class Iter { T get_next(); };

Re: [C++-sig] Iterators for heterogeneous container

2009-11-05 Thread Michele De Stefano
Thomas, I think the answer is here: http://www.boost.org/doc/libs/1_40_0/libs/python/doc/tutorial/doc/html/python/iterators.html but you should modify your "Garden" class in order to support "begin" and "end" iterators for "tomatoes" and "potatoes". With these modifications: class Garden { publ