ideas about ranges

Andrei Alexandrescu SeeWebsiteForEmail at
Thu May 21 22:37:54 PDT 2009

Steven Schveighoffer wrote:
> On Thu, 21 May 2009 17:40:27 -0400, Jason House 
> < at> wrote:
>> Steven Schveighoffer Wrote:
>>> So what I think we may need is a different range primitive:
>>> An iterable range defines: (name to be decided)
>>> bool empty()
>>> T popNext()
>>> An input range is an iterable range that also defines:
>>> T front();
>>> popFront();
>> This is exactly like what Andrei posted as his design.
>> Your iterable range = Andrei's input range
>> Your input range = Andrei's forward range
> If that's true, then I apologize, I was looking at the current docs, and 
> Andrei's post about having some sort of "save" method.  The current docs 
> definitely are not the same as what I proposed.
> And in any case, my proposal requires a change to the compiler for 
> foreach.  I haven't seen that talked about yet.  If that's in the works, 
> then that's cool.  As I've said before, I don't need credit, I just like 
> to have the ideas knocked around.
> -Steve

There are quite a few subtle points about the discussion you started, 
and a few subtler subpoints still. I've had a busy day so I couldn't 
answer, but I'll try tomorrow.


More information about the Digitalmars-d mailing list