Shout out to D at cppcon, when talkign about ranges.

bitwise via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 30 21:07:57 PDT 2015


On Thursday, 1 October 2015 at 02:53:25 UTC, lobo wrote:
> On Thursday, 1 October 2015 at 01:54:22 UTC, bitwise wrote:
>> On Thursday, 1 October 2015 at 01:32:17 UTC, bitwise wrote:
>>> I don't think it would be that hard to make something this 
>>> possible:
>>>
>>> for(int x : iota<int>(0, 5).to<take>(3))
>>>     printf("%d ", x);
>>
>>
>> Curiosity got the best of me:
>> http://ideone.com/RoJxLa
>>
>> output doesn't show up for some reason, but it works.
>>
>>     Bit
>
> Yes, that's what we have always done with iterators. The point 
> is users shouldn't have to write or instantiate iterators 
> explicitly for any custom range.
>
> bye,
> lobo

I understand, but the C++ committee seems very conservative to 
me, so when it's this easy to add for(:) support by giving ranges 
begin()/end() functions, it makes me doubt they will actually 
change the language for it.

     Bit



More information about the Digitalmars-d mailing list