how to do iota(0,256) with ubytes ? (cf need for iotaInclusive)

Per Nordlöw via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 12 01:32:46 PDT 2015


On Monday, 12 October 2015 at 08:20:12 UTC, Per Nordlöw wrote:
> What about adding an overload supporting
>
>     iota!ubyte(0, 256)
>
> ?

Ahh, already present of course, according to declaration

auto iota(B, E)(
   B begin,
   E end
)
if (isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, 
E)));

This will make `B` be ubyte and `E` be int.

I guess current behaviour is to return a range where 
`ElementType` is `CommonType!(ubyte, int)` which is `int`.


More information about the Digitalmars-d mailing list