IntFlags

A bitset that can be used to track integer math failures.

IntFlags is also a forward range which can be used to iterate over the set (raised) IntFlag values. Fully consuming the range is equivalent to calling clear(); iterate over a copy made with save(), instead, if this clearing is undesired.

Constructors

this
this(IntFlags that)

Assign the set of flags represented by that to this IntFlags. Note that IntFlag values are accepted also, because IntFlag is implicitly convertible to IntFlags.

Alias This

anySet

ditto

Members

Functions

clear
IntFlags clear()

Clear all flags, and return the set of flags that were previously set.

opBinary
IntFlags opBinary(IntFlags that)
opOpAssign
IntFlags opOpAssign(IntFlags that)

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

popFront
IntFlags popFront()

Clear the first set IntFlag. This is equivalent to flags -= flags.front.

toString
string toString()

Get a string representation of the list of set flags.

toString
void toString(Writer w, FormatSpec!Char fmt = (FormatSpec!Char).init)

Puts a string representation of the list of set flags into w. This overload will not allocate, unless std.range.primitives.put(w, ...) allocates.

Properties

anySet
bool anySet [@property getter]

true if any non-null flag is set, otherwise false.

empty
bool empty [@property getter]

true if no non-null flags are set.

front
IntFlag front [@property getter]

Get the first set IntFlag.

length
uint length [@property getter]

Get the number of raised flags.

save
IntFlags save [@property getter]

Get a mutable copy of this IntFlags value, so as not to clear() the original by iterating through it.

Static variables

local
IntFlags local;

The standard IntFlags set for the current thread. raise!(IntFlagPolicy.sticky)() mutates this variable.

Variables

all
enum IntFlags all;

An IntFlags value with all possible flags raised.

pushPop
enum string pushPop;

A mixin string that may be used to (effectively) push a new IntFlags.local variable onto the stack at the beginning of a scope, and restore the previous one at the end.

Meta