[#mp_units-clamp_to_range]
= xref:mp_units.adoc[mp&lowbar;units]::clamp&lowbar;to&lowbar;range
:relfileprefix: ../
:mrdocs:

Policy that clamps the value to &lsqb;min, max&rsqb;&period;

== Synopsis

Declared in `&lt;mp&hyphen;units&sol;overflow&lowbar;policies&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;xref:mp_units/Quantity.adoc[Quantity] Q&gt;
struct clamp&lowbar;to&lowbar;range;
----

== Description

Saturates out&hyphen;of&hyphen;range values to the nearest boundary&period; Use when you want to &quot;correct&quot; invalid values rather than signal an error&period;

== Member Functions

[cols=1]
|===
| Name
| xref:mp_units/clamp_to_range/operator_call.adoc[`operator()`] 
|===

== Data Members

[cols=1]
|===
| Name
| xref:mp_units/clamp_to_range/max.adoc[`max`] 
| xref:mp_units/clamp_to_range/min.adoc[`min`] 
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
