IEnum

Interface defining the basic functionality of an enum class.

Members

Aliases

Name
alias Name = istring

Aliases for the types of an enum class' names & values.

Value
alias Value = int
Undocumented in source.
opBinaryRight
alias opBinaryRight(istring op : "in") = opIn_r

Support for the 'in' operator

Functions

length
size_t length()
max
Value max()
min
Value min()
opApply
int opApply(int delegate(ref const(Name) name, ref const(Value) value) dg)

foreach iteration over the names and values in the enum.

opApply
int opApply(int delegate(ref size_t i, ref const(Name) name, ref const(Value) value) dg)

foreach iteration over the names and values in the enum and their indices.

opIn_r
Name* opIn_r(Value v)

Looks up an enum member's name from its value.

opIn_r
Value* opIn_r(Name n)

Looks up an enum member's value from its name.

opIndex
Name opIndex(Value v)

Looks up an enum member's name from its value, using opIndex.

opIndex
Value opIndex(Name n)

Looks up an enum member's value from its name, using opIndex.

Meta