annotate dmd/EnumUtils.d @ 192:eb38fdcb3e62 default tip

updated to compile with dmd2.062
author korDen
date Sat, 02 Mar 2013 01:25:52 -0800
parents 10317f0c89a5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
1 module dmd.EnumUtils;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
2
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
3 string BringToCurrentScope(alias enumType)()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
4 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
5 string s = "";
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
6 foreach (i, e; __traits(allMembers, enumType)) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
7 s ~= "alias " ~ enumType.stringof ~ "." ~ __traits(allMembers, enumType)[i] ~ " " ~ __traits(allMembers, enumType)[i] ~ ";\n";
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
8 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
9
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
10 return s;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
11 }