On Saturday, 24 January 2015 at 20:49:03 UTC, Dominikus Dittes Scherkl wrote:
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?

iota(0, 256).map!(x => foo(cast(ubyte) x))
  • using the full range of u... Dominikus Dittes Scherkl via Digitalmars-d-learn
    • Re: using the full r... H. S. Teoh via Digitalmars-d-learn
    • Re: using the full r... bearophile via Digitalmars-d-learn
    • Re: using the full r... Tobias Pankrath via Digitalmars-d-learn
      • Re: using the fu... Dominikus Dittes Scherkl via Digitalmars-d-learn
        • Re: using th... ketmar via Digitalmars-d-learn
          • Re: usin... Dominikus Dittes Scherkl via Digitalmars-d-learn
            • Re:... ketmar via Digitalmars-d-learn
              • ... Vlad Levenfeld via Digitalmars-d-learn
                • ... bearophile via Digitalmars-d-learn
                • ... Dominikus Dittes Scherkl via Digitalmars-d-learn
                • ... Tobias Pankrath via Digitalmars-d-learn
                • ... Dominikus Dittes Scherkl via Digitalmars-d-learn
                • ... bearophile via Digitalmars-d-learn

Reply via email to