iz.enumset

Utilities related to D named enumerations.

Members

Aliases

Set128
alias Set128 = ucent

Container for a EnumSet based on an enum which has up to 128 members (not working, relies on ucent).

Set16
alias Set16 = ushort

Container for a EnumSet based on an enum which has up to 16 members.

Set32
alias Set32 = uint

Container for a EnumSet based on an enum which has up to 32 members.

Set64
alias Set64 = ulong

Container for a EnumSet based on an enum which has up to 64 members.

Set8
alias Set8 = ubyte

Container for a EnumSet based on an enum which has up to 8 members.

Functions

enumMemberCount
size_t enumMemberCount()

Returns the member count of an enum.

enumSet
auto enumSet(A a)

Returns an EnumSet using the smallest container possible.

isCallableFromEnum
bool isCallableFromEnum()

returns true if T and E are suitable for constructing an EnumProcs

isSetSuitable
bool isSetSuitable()

Returns true if the parameter is suitable for being used as a EnumSet container.

Mixin templates

AliasedEnumMembers
mixin template AliasedEnumMembers(E, string prefix = "")

Alias the members of an enum, allowing to use them without the parent name, and making the use of EnumSet more friendly.

Static functions

enumFitsInSet
bool enumFitsInSet()

Indicates if the members of an enum fit in a container.

Structs

EnumIndexedArray
struct EnumIndexedArray(E, T, bool staticArray = false)

Encapsulates an array of T and uses the rank of the enum members E to perform the actions usually done with integer indexes.

EnumProcs
struct EnumProcs(E, T)

CallTable based on an enum. It can be compared to an associative array of type ET. Additionally an EnumSet can be used to fire a burst of call.

EnumRankInfo
struct EnumRankInfo(E)

Provides the information about the rank of the members of an enum. The properties are all static and can be retrieved from a template alias.

EnumSet
struct EnumSet(E, S)

An EnumSet allows to create a bit field using the members of an enum.

Templates

SmallestSet
template SmallestSet(E)

Aliases the smallest set in which E fits.

Meta