On 10/12/2015 10:51 PM, Nordlöw wrote:
On Monday, 12 October 2015 at 20:39:11 UTC, Andrei Alexandrescu wrote:
Alexandrescu wrote:
We can add iota!T() with no arguments that spans the entire range of T
(integral). -- Andrei

 From a quick glance I couldn't find a way to reuse the existing
overloads. Can anybody come with a reusing solution?

auto iota(T)(){
    import std.range;
    return chain(iota(T.min,T.max),only(T.max));
}

void main(){
    import std.stdio;
    writeln(iota!byte());
    writeln(iota!dchar());
}

Reply via email to