Ranges - Question about desing choices

cym13 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 25 02:59:41 PDT 2015


On Monday, 24 August 2015 at 17:59:00 UTC, Michal Minich wrote:
> Ok. What about this: there exactly the same 3 primitives as in 
> D range, but popFront is requred to be called first, before 
> calling front, or empty properties. Why current approach 
> against this?

Wouldn't that mean a null placeholder for the first popFront? 
That could be done though.

However I'm not certain IĀ understand what you wrote, do you mean 
that in foreach loops popFront would be called first or do you 
mean that each time you call front or empty the popFront method 
is called beforehand?

I don't have much opinion about the former, but the later would 
be very problematic.



More information about the Digitalmars-d-learn mailing list