Are iterators and ranges going to co-exist?

Peter Alexander peter.alexander.au at gmail.com
Mon Jul 19 13:37:22 PDT 2010


I've been following the D programming language for quite some time now, 
and only recently decided to dive in and start using it. My first 
impressions are that it is a very nice language (despite the library 
bugs), but one thing in particular that confused me was the lack of 
iterators, and their near complete replacement by ranges.

I did notice that there is an std.iterator library, which is said to be 
"growing" in the documentation.

What is the plan for this library? Will the std.algorithm start to use a 
mixture of iterators and ranges (as it should, in my opinion)?

In his article, "On Iteration" 
(http://www.informit.com/articles/article.aspx?p=1407357&seqNum=12) 
Andrei admitted that ranges had weaknesses when compared to iterators, 
so I would be very disappointed if iterators weren't to make it into the 
standard library.

In the thread on improving std.algorithm.find, there were mentions of 
making find (or some findFirst) that returned a single element. Would 
this be an iterator, or a single value range?




More information about the Digitalmars-d mailing list