Iterators for D

Walter Bright newshound at digitalmars.com
Tue Nov 7 09:47:08 PST 2006


Sean Kelly wrote:
> Since D has slicing, the argument for using 
> iterators to define the boundaries of a range of randomly accessible 
> elements seems kind of small to me.  ie.
> 
>     sort( a.begin, a.begin + 5 ); // sort the first 5 elements
> or
>     sort( a[0 .. 5] );
> 
> I find the second to be cleaner to look at.  But I'm undecided whether 
> we'd lose any power or flexibility by not bothering with random access 
> iterators.

Hmm, instead of 'pointers as iterators', have 'arrays as iterators'. 
That definitely sounds like a good area to explore.



More information about the Digitalmars-d mailing list