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

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 12 14:28:44 PDT 2015


On 10/12/15 11:51 PM, Nordlöw wrote:
> On Monday, 12 October 2015 at 20:39:11 UTC, Andrei Alexandrescu wrote:
>>> Alexandrescu wrote:
>>>> We can add iota!T() with no arguments that spans the entire range of T
>>>> (integral). -- Andrei
>
>  From a quick glance I couldn't find a way to reuse the existing
> overloads. Can anybody come with a reusing solution?

One possibility (can't look at the code now) is to change the 
implementation to use a closed interval for state, then use that. But 
then you still need to mind overflow. Whole range is just a bit special 
like that. -- Andrei


More information about the Digitalmars-d mailing list