IntFlags.opBinary

Test (&), set (|), or unset (-) individual flags.

  1. IntFlags opBinary(IntFlags that)
    struct IntFlags
    const @safe pure nothrow @nogc
    opBinary
    (
    string op
    )
    if (
    op.among!("&", "|", "-")
    )
  2. IntFlags opOpAssign(IntFlags that)

Examples

IntFlags flags = IntFlag.undef | IntFlag.posOver | IntFlag.negOver;

flags &= IntFlag.posOver | IntFlag.negOver;
assert(!(flags & IntFlag.undef));

flags -= IntFlag.undef | IntFlag.negOver;
assert(  flags & IntFlag.posOver);
assert(!(flags & IntFlag.negOver));

Meta