[#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, xref:mp_units/ConstraintPolicy.adoc[ConstraintPolicy] 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. == Type Aliases [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-08b.adoc[mp_units::operator+]` | Unary plus operator |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:mp_units/operator_mod-09.adoc[`operator%`] | Modulus operator | xref:mp_units/operator_star-05e.adoc[`operator*`] | Multiplication operator | xref:mp_units/operator_star-09.adoc[`operator*`] | Multiplication operator | xref:mp_units/operator_star-0c6.adoc[`operator*`] | Multiplication operator | xref:mp_units/operator_plus-0203.adoc[`operator+`] | Addition operator | xref:mp_units/operator_plus-065.adoc[`operator+`] | Addition operator | xref:mp_units/operator_plus-08a.adoc[`operator+`] | Addition operator | xref:mp_units/operator_minus-05.adoc[`operator‐`] | Subtraction operator | xref:mp_units/operator_minus-06.adoc[`operator‐`] | Subtraction operator | xref:mp_units/operator_minus-09.adoc[`operator‐`] | Subtraction operator | xref:mp_units/operator_slash-01.adoc[`operator/`] | Division operator | xref:mp_units/operator_slash-0a5.adoc[`operator/`] | Division operator | xref:mp_units/operator_slash-0e1.adoc[`operator/`] | Division operator |=== == Template Parameters [cols="1,4"] |=== | Name| Description | *T* | the underlying representation type | *ErrorPolicy* | policy type satisfying ConstraintPolicy (provides static on_constraint_violation(std::string_view)) |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#