getNext

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Jul 9 07:21:33 PDT 2012


On 7/9/12 10:07 AM, Mehrdad wrote:
> On Monday, 9 July 2012 at 14:03:17 UTC, Andrei Alexandrescu wrote:
>> On 7/9/12 5:14 AM, Mehrdad wrote:
>>> Really, doing something simple should be simple.
>>>
>>> I don't have any brilliant ideas, but one guess would be nullable
>>> types... if you can return a nullable value, your interface for an
>>> interface could just be:
>>>
>>> T? next();
>>>
>>> and that's it... it would return null if nothing is left.
>>
>> What if you want to return a reference so the user can change it?
>>
>> Andrei
>
> Huh? You don't... it's an input iterator, not an output iterator!

The idea of an input range is that it works seamlessly with the more 
capable ranges.

Andrei


More information about the Digitalmars-d mailing list