[#mp_units-constrained] = xref:mp_units.adoc[mp_units]::constrained :relfileprefix: ../ :mrdocs: A transparent wrapper that carries an error policy for domain constraint enforcement. == Synopsis Declared in `<mp‐units/constrained.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename T, typename ErrorPolicy = xref:mp_units/throw_policy.adoc[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 [cols=1] |=== | Name | xref:mp_units/constrained/error_policy.adoc[`error_policy`] | xref:mp_units/constrained/value_type.adoc[`value_type`] |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:mp_units/constrained/2constructor-00.adoc[`constrained`] [.small]#[constructor]# | Constructors | xref:mp_units/constrained/operator_mod_eq.adoc[`operator%=`] | Modulus assignment operator | xref:mp_units/constrained/operator_star_eq.adoc[`operator*=`] | Multiplication assignment operator | xref:mp_units/constrained/operator_inc-0f.adoc[`operator++`] | Increment operators | xref:mp_units/constrained/operator_plus_eq.adoc[`operator+=`] | Addition assignment operator | xref:mp_units/constrained/operator_dec-0f.adoc[`operator‐‐`] | Decrement operators | xref:mp_units/constrained/operator_minus_eq.adoc[`operator‐=`] | Subtraction assignment operator | xref:mp_units/constrained/operator_slash_eq.adoc[`operator/=`] | Division assignment operator | xref:mp_units/constrained/value.adoc[`value`] | | xref:mp_units/constrained/2conversion.adoc[`operator T`] | Conversion to `T` |=== == Data Members [cols=1] |=== | Name | xref:mp_units/constrained/value_.adoc[`value_`] |=== == Friends [cols="1,4"] |=== |Name|Description | `xref:mp_units/operator_minus-0e.adoc[mp_units::operator‐]` | Unary minus operator | `xref:mp_units/operator_plus-08.adoc[mp_units::operator+]` | Unary plus operator |=== == Template Parameters [cols="1,4"] |=== |Name|Description | *T* | the underlying representation type | *ErrorPolicy* | policy type providing static on_constraint_violation(const char*) |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#