iterators again

Bill Baxter dnewsgroup at billbaxter.com
Sun May 27 16:47:20 PDT 2007


What's the deal with making iterators be classes in D, rather than 
simple value types like they are in C++?  I see that tango uses classes, 
and DTL used them too.  Chris commented over on the Tango forum that 
"there are problems with using structs".  So what are they?

The way people describe iterators in C++ is as a generalization of a 
pointer.  Including the fact that they are value types and can be 
copied.  DTL and tango iterators can't even be copied at all.  Just 
seems like a struct makes more sense for an iterator in D.

--bb



More information about the Digitalmars-d mailing list