alias to fully qualified enum in scope where enum is expected

Timothee Cour via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 5 23:11:43 PDT 2014


Is there a simple way to to do this?

enum A{
a1,
a2
}

void fun(A a){...}
void test(){
 fun(A.a1); //works
 fun(a1); //I'd like a1 to work, but just where an A is expected to avoid
polluting namespace.
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20140805/82f83520/attachment.html>


More information about the Digitalmars-d-learn mailing list