opStar [OT]

Lutger lutger.blijdestijn at gmail.com
Wed Nov 14 07:50:11 PST 2007


Sean Kelly wrote:
> 
> The great thing about iterators is that they act as a sort of bookmark, 
> so the result of an operation can be stored in a generic manner.  But 
> algorithms like sorting, searching, and so on, all operate on a range, 
> and D has these already in the form of slices.  Assuming that we had 
> random access iterators as well, I'd use them to define a slice and 
> perform my operation that way rather than pass them in separately.
> 
> 
> Sean

There's a funny little remark in 'The C++ programming language' by 
Stroustrup about this. He mentions that a lot of algorithms operate on 
ranges which are just iterator pairs, shows how to define such a type 
yourself and then apologises to the reader that the STL doesn't include 
ranges (or sequences as he calls them).




More information about the Digitalmars-d mailing list