On Sunday, 15 October 2017 at 08:47:42 UTC, Domain wrote:
void f(int i)
{
    writeln("i");
}

void f(E)(E e) if (is(E == enum))
{
    writeln("e");
}

enum E { A }
E e = E.A;
f(e);    // output i

How can I overload with enum type?

I know I can do that with this:

void f(T)(T i) if (is(T == int))
{
    writeln("i");
}

But that looks strange.

Reply via email to