std.range design part of the language..?

simendsjo simen.endsjo at pandavre.com
Sun Aug 15 10:12:06 PDT 2010


 From http://digitalmars.com/d/2.0/statement.html#ForeachStatement, 
"Foreach over Structs and Classes with Ranges".

I read this as the Range design is a part of the language now. Is this 
correct?

And is the spec a bit out of date in the examples?
It says foreach-/reverse translates to

for( auto __r = range; !__r.empty; __r.next /* or __r.retreat */)
	auto e = __r.head; // or __r.toe

Should this be the following?
for( auto __r = range; !__r.empty; __r.popFront /* or __r.popBack */)
	auto e = __r.front; // or __r.back


More information about the Digitalmars-d-learn mailing list