number ranges

Tejas notrealemail at gmail.com
Wed Jan 19 03:00:49 UTC 2022


On Tuesday, 18 January 2022 at 20:43:08 UTC, forkit wrote:
> On Tuesday, 18 January 2022 at 16:02:42 UTC, Tejas wrote:
>>
>> Newer languages nowadays use `start..<end` to denote the 
>> intent, think it's something we should follow?
>
> I've decided to avoid using number ranges 'directly', and 
> instead use a wrapper function...
>
>
> auto range(T:T)(T a, T b)
> {
>     import std.range : iota;
>     return iota(a, (b+1));
> }

Aww, come on; it ain't that bad...


More information about the Digitalmars-d-learn mailing list