Adobe Source Libraries 1.49.0
A collection of C++ libraries.
|
enum_ops
provides optional typesafe bitset and arithmetic operations for enumeration types. Without these typesafe operations, the compiler will promote the operand(s) to the appropriate integral type, and the result will be an integral type. When the typesafe operations have been defined for an enumeration type, E
, the result will be of type E
exactly when the operand(s) are of type E
.
ADOBE_DEFINE_BITSET_OPS(E)
or auto adobe_enable_bitmask_enum(E) -> std::true_type; enables the bitset operations ~, |, &, ^, |=, &=, ^=
for enumeration type E
.
ADOBE_DEFINE_ARITHMETIC_OPS(E)
or auto adobe_enable_arithmetic_enum(E) -> std::true_type; enables the typesafe arithmetic operations +, -, *, /,
%, +=, *=, -=, /=, %=
for enumeration type E
.
Defined in adobe/enum_ops.hpp
The following is an example of code that will compile:
The following is contains an example of code that will not compile since the typesafe operators have not been defined.