Any chance to call Tango as Extended Standard Library

Sergey Gromov snake.scaly at gmail.com
Sun Jan 18 15:54:31 PST 2009


Sun, 18 Jan 2009 15:32:26 -0800, Andrei Alexandrescu wrote:

> Sergey Gromov wrote:
>> Sun, 18 Jan 2009 07:21:55 -0800, Andrei Alexandrescu wrote:
>> 
>>> http://www.digitalmars.com/d/2.0/statement.html#ForeachStatement
>>>
>>> Scroll down to "Foreach over Structs and Classes with Ranges". The 
>>> changelog reflects that too:
>> 
>> How do I implement a range that supports more than one pass?  From the
>> docs, all ranges seem to be essentially Input ranges currently.  That is
>> 
>> MyIterable collection;
>> foreach (element; collection) {} // OK, iterates
>> foreach (element; collection) {} // oops, it's empty!
> 
> Note that the range is being copied into a hidden variable, so after the 
> first iteration the collection will still hold its ground.

Unless it's a class you mean?



More information about the Digitalmars-d mailing list