A transparent wrapper that carries an error policy for domain constraint enforcement.
<mp-units/constrained.h>template<
typename T,
typename ErrorPolicy = throw_policy>
class constrained;
This wrapper does not check anything itself. It serves as a signal to the mp-units library that domain constraint violations should be reported via the ErrorPolicy rather than through precondition checks.
All arithmetic operations are forwarded to the underlying type T.
| Name |
|---|
error_policy |
value_type |
| Name | Description |
|---|---|
constrained [constructor] | Constructors |
operator%= | Modulus assignment operator |
operator*= | Multiplication assignment operator |
operator++ | Increment operators |
operator+= | Addition assignment operator |
operator-- | Decrement operators |
operator-= | Subtraction assignment operator |
operator/= | Division assignment operator |
value | |
operator T | Conversion to T |
| Name |
|---|
value_ |
| Name | Description |
|---|---|
| T | the underlying representation type |
| ErrorPolicy | policy type providing static on_constraint_violation(const char*) |