Struct BitFlags

Allows to use enum values as a set of bit flags.

struct BitFlags(E)
  
if (isBitFlagEnum!E);

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

NameDescription
this (field) Constructs BitFlags from field.

Methods

NameDescription
opAssign (that) Assigns a bit field.
opBinary (that) Tests (&), sets (|) or toggles (^) bits.
opBinaryRight (that) Tests (&), sets (|) or toggles (^) bits.
opCast () Converts BitFlags to a boolean.
opCast () Converts to the original type of E (int by default).
opEquals (that) Compares this BitFlags object to another bit field.
opOpAssign (that) Tests (&), sets (|) or toggles (^) bits.
opUnary () Inverts all bit flags.
toHash () Generates a hash value of this object.

Parameters

NameDescription
E Some enum.