Range returned by iota and const

André Stein stone-remove at NOSPAMsteinsSPAMoft-remove-.net
Tue Apr 17 10:22:30 PDT 2012


Hi,

I'm trying to pass the range returned by iota to a function accepting 
the parameter as const. I got compilation errors when trying to use the 
index operator and after some investigation it turned out that opSlice 
of iota.Result isn't declared as const.

The function body of opSlice of iota.Result doesn't seem to mutate the 
range so is there any special reason why it isn't declared as such? (the 
same holds for opSlice).

Regards,
André


More information about the Digitalmars-d-learn mailing list