enum E { x, y, z, Z = z, Y = y } import std.algorithm.comparison : equal; assert(enumMembersAsEnumerators!E.equal([E.x, E.y, E.z, E.Z, E.Y])); // run-time assert(uniqueEnumMembers!E.equal([E.x, E.y, E.z])); // run-time // static assert(uniqueEnumMembers!E.equal([E.x, E.y, E.z])); // compile-time static assert(E.x == 0); static assert(E.y == 1); static assert(E.z == 2); static assert(E.Z == E.z); static assert(E.Y == E.y);
http://forum.dlang.org/post/ziappmtvucmuefphblse@forum.dlang.org http://forum.dlang.org/post/awihyvzjswwayeqtklly@forum.dlang.org http://forum.dlang.org/thread/bspwlfypfishykezzocx@forum.dlang.org#post-dguqnroxbfewerepomwq:40forum.dlang.org https://issues.dlang.org/show_bug.cgi?id=10951
Dynamic Variant of EnumMembers excluding the enumerator aliases.