On Mon, Oct 12, 2015 at 1:41 PM, Andrei Alexandrescu via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
On 10/12/15 10:55 PM, Timothee Cour via Digitalmars-d wrote:
that's only a partial fix:
I also would like to express:

iotaInclusive(1,256)

iota!ubyte.drop(1)

iotaInclusive(1,256,3)

iota!ubyte.drop(1).stride(3)

That's not a good workaround; it's error-prone in more general cases:

auto fun(ubyte a, ubyte stride){
// return iotaInclusive(a,256, stride);// simple
// error prone with your suggestion:
auto b=some function of a, stride; 
return iota!ubyte.drop(b).stride(stride);
}

 

Just playing devil's advocate.


Andrei