RFC on range design for D2

Steven Schveighoffer schveiguy at yahoo.com
Fri Sep 12 07:33:42 PDT 2008


"Bill Baxter" wrote
> I think one thing to consider is what it will take to make a new
> container support and "play nice" with the regime proposed.  This
> touches on Andrei's point about being hard pressed to think of generic
> algorithms to run on an HMM, too.
>
> The first question is who do you want to "play nice" with?  If you're
> going to be writing functions specifically for that container, then
> you don't really have to play nice with anyone.  Your container just
> needs to have the operations necessary to support those functions.

Bill, thanks so much for explaining it like this, I really agree with what 
you say.  My concern is that iterator is going to become a 'bad word' and 
considered a flawed design.

But you are right, there is no need for iterators to be allowed for 
std.algorithm, I totally agree with that, I just assumed Andrei meant 
iterators would be discouraged for everything, including general use as 
pointers into container objects.  If that is not the case, then I 
wholeheartedly agree that algorithms should be restricted to ranges, and 
iterators should be used only in container operations.

Cheers!

-Steve 




More information about the Digitalmars-d-announce mailing list