Range of variables

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Sep 30 14:05:32 PDT 2015


On Wednesday, 30 September 2015 at 20:11:56 UTC, Freddy wrote:
> Is there a way to make a range of a variables lazily?
> ---
> int var1;
> int var2;
> void func()
> {
>     int var3;
>     auto range = /*range of var1,var2,var3*/ ;
> }
> ---

There's std.range.only which gives you a range over the arguments 
you pass without allocating an array for them. Not sure what you 
mean by "lazily".

http://dlang.org/phobos/std_range.html#only


More information about the Digitalmars-d-learn mailing list