A transparent wrapper that carries an error policy for domain constraint enforcement.
Synopsis
Declared in <mp‐units/constrained.h>
template<
typename T,
ConstraintPolicy ErrorPolicy = throw_policy>
class constrained;
Description
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.
Types
Member Functions
Name |
Description |
|
Constructors |
Modulus assignment operator |
|
Multiplication assignment operator |
|
Increment operators |
|
Addition assignment operator |
|
Decrement operators |
|
Subtraction assignment operator |
|
Division assignment operator |
|
Conversion to |
Data Members
Name |
Friends
| Name | Description |
|---|---|
Unary minus operator |
|
Unary plus operator |
Template Parameters
| Name | Description |
|---|---|
T |
the underlying representation type |
ErrorPolicy |
policy type satisfying ConstraintPolicy (provides static on_constraint_violation(std::string_view)) |
Created with MrDocs