nxt.enums

Extensions to Enumerations.

Members

Structs

EnumUnion
struct EnumUnion(E...)

Instance Wrapper for UnionEnum. Provides safe assignment and explicit casts. TODO: Use opImplicitCastTo instead of opCast when it becomes available in DMD.

Templates

ChainEnum
template ChainEnum(E...)

Chain (Append, Concatenate) Member Names of Enumerations E. All enumerator names of E must be unique.

UnionEnum
template UnionEnum(E...)

Unite (Join) Members (both their Names and Values) of Enumerations E. All enumerator names and values of E must be unique.

Meta

Authors

TODO: Implement bidirection conversions: http://forum.dlang.org/thread/tuafkxmnntqjgycziixn@forum.dlang.org#post-tuafkxmnntqjgycziixn:40forum.dlang.org

TODO: Join logic for ChainEnum and UnionEnum into common and then define: - UnionEnum: only names must be unique - StrictUnionEnum: both names and values must be unique

TODO: Move to std.typecons (Type Constructor) in Phobos when ready.