IntFlags.opBinary

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

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

Examples

1 IntFlags flags = IntFlag.undef | IntFlag.posOver | IntFlag.negOver;
2 
3 flags &= IntFlag.posOver | IntFlag.negOver;
4 assert(!(flags & IntFlag.undef));
5 
6 flags -= IntFlag.undef | IntFlag.negOver;
7 assert(  flags & IntFlag.posOver);
8 assert(!(flags & IntFlag.negOver));

Meta