BitFlags

Allows to use $(D_KEYWORD enum) values as a set of bit flags.

$(D_PSYMBOL BitFlags) behaves the same as a bit field of type E, but does additional cheks to ensure that the bit field contains only valid values, this is only values from E.

Constructors

this
this(E field)

Constructs $(D_PSYMBOL BitFlags) from field.

Members

Functions

opAssign
BitFlags opAssign(E that)

Assigns a bit field.

opBinary
BitFlags opBinary(E that)
BitFlags opBinary(BitFlags that)
opBinaryRight
BitFlags opBinaryRight(E that)

Tests (&), sets (|) or toggles (^) bits.

opCast
bool opCast()

Converts $(D_PSYMBOL BitFlags) to a boolean.

opCast
OriginalType!E opCast()

Converts to the original type of E ($(D_KEYWORD int) by default).

opEquals
bool opEquals(E that)
bool opEquals(BitFlags that)

Compares this $(D_PSYMBOL BitFlags) object to another bit field.

opOpAssign
BitFlags opOpAssign(E that)
BitFlags opOpAssign(BitFlags that)

Tests (&), sets (|) or toggles (^) bits.

opUnary
BitFlags opUnary()

Inverts all bit flags.

toHash
size_t toHash()

Generates a hash value of this object.

Parameters

E

Some $(D_KEYWORD enum).

Meta