alias this is only useful when not using any function that relies on the template constraints in std.traits.

For example

import std.traits;

void someFunc(N)(N val) if (isNumeric!N)
{
    int b = val;
}

void main()
{
    import std.typecons;
    Nullable!int a = 42;

    someFunc(a);
}

$ dmd test.d
test.d(13): Error: template someFunc cannot deduce function from argument types !()(Nullable!(int))

Removing the template constraint makes it compile and run just fine. What's a good work around for these types of issues?

Reply via email to