IntFlags.opOpAssign

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

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

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