How to overload with enum type?

Domain dont_email at empty.com
Sun Oct 15 08:47:42 UTC 2017


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?


More information about the Digitalmars-d-learn mailing list