using the full range of ubyte with iota

Dominikus Dittes Scherkl via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jan 24 12:49:01 PST 2015


Maybe I'm just too stupid, but I cannot manage to call a simple 
function
with all 256 possible values of ubyte with iote:

int foo(ubyte c);

auto myRange = iota(0,256).map!foo;

-->  Error: function foo(ubyte c) is not callable using argument 
types (int)

and this is because of the f*** end-type cannot be ubyte because 
in phobos everywhere end is excluded, so I have to define it too 
large by one.

Has anyone any idea how to work around this?
I would have no problem using an explicit cast, but where should 
I apply it?


More information about the Digitalmars-d-learn mailing list