cpp/named req/BitmaskType

Defines a type that can be used to represent a set of constant values or any combination of those values. This trait is typically implemented by integer types, std, or enumerations (scoped and unscoped) with additional operator overloads.

Requirements
The bitmask type supports a finite number of bitmask elements, which are distinct non-zero values of the bitmask type, such that, for any pair and,  is nonzero and  is zero. In addition, the value is used to represent an empty bitmask, with no values set.

The bitwise operators, , , , , , and are defined for values of the bitmask type and have the same semantics as the corresponding built-in operators on unsigned integers would have if the bitmask elements were the distinct integer powers of two.

The following expressions are well-formed and have the following meaning for any :

Each representable bitmask element is defined as a value of the bitmask type.

Usage
The following standard library types satisfy :
 * std
 * std
 * std
 * std
 * std
 * std
 * std
 * std
 * std
 * std
 * std
 * std
 * std

Code that relies on some particular implementation option (e.g. ), is nonportable because std is not necessarily implicitly convertible to.