std.range.iota enhancement: supporting more types (AKA issue 10762)

monarch_dodra monarchdodra at gmail.com
Tue Dec 24 03:28:00 PST 2013


On Tuesday, 24 December 2013 at 11:05:05 UTC, Jakob Ovrum wrote:
> On Tuesday, 24 December 2013 at 10:38:17 UTC, Francesco 
> Cattoglio wrote:
>> The range will only be a RA range for types that implement 
>> (inc * n) and ((end - begin) / step) (used for lenght 
>> computation), otherwise it will be a ForwardRange, because it 
>> can't be directional if we can't compute the last element in 
>> O(1).
>
> Bidirectionality and random access are separate capabilities; 
> the former can be supported without the latter through.

Actually, if the range is infinite, then you can also have RA 
without bidirectionality.


More information about the Digitalmars-d mailing list