www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Range of variables

reply Freddy <Hexagonalstar64 gmail.com> writes:
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*/ ;
}
---
Sep 30 2015
next sibling parent anonymous <anonymous example.com> writes:
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
Sep 30 2015
prev sibling parent Atila Neves <atila.neves gmail.com> writes:
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*/ ;
 }
 ---
std.range.iota Atila
Oct 01 2015