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

Vladimir Panteleev via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 12 14:02:31 PDT 2015


On Monday, 12 October 2015 at 16:34:09 UTC, Andrei Alexandrescu 
wrote:
> On 10/12/15 11:20 AM, Per Nordlöw wrote:
>> On Friday, 9 October 2015 at 02:41:50 UTC, Timothee Cour wrote:
>>> of course this doesn't work:
>>> auto b=iota(ubyte(0), ubyte(256));
>>> //cannot implicitly convert expression (256) of type int to 
>>> ubyte
>>
>> What about adding an overload supporting
>>
>>      iota!ubyte(0, 256)
>
> We can add iota!T() with no arguments that spans the entire 
> range of T (integral). -- Andrei

Nice, that'll also be consistent with uniform!T().


More information about the Digitalmars-d mailing list