void foo1(ubyte x) {}
void foo1(ushort x) {}
void foo1(uint x) {}
void foo1(ulong x) {}

import std.traits : isUnsigned, Unqual;
void foo2(T)(Unqual!T x) if(isUnsigned!T) {}

    void main()
    {
        import std.math;

        int s = 1;
        foo1(abs(s));
        foo2(abs(s)); //failed?
    }

/*
onlineapp.d(15): Error: template `onlineapp.foo2` cannot deduce function from argument types `!()(int)`
onlineapp.d(7):        Candidate is: `foo2(T)(Unqual!T x)`
*/

Reply via email to