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

Policy that wraps the value into the half&hyphen;open range &lsqb;min, max)&period;&rsqb;

== 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 wrap&lowbar;to&lowbar;range;
----

== Description

Uses modulo arithmetic to wrap values into the range&period; Use for periodic&sol;cyclic quantities (angles, time&hyphen;of&hyphen;day, etc&period;)&period; For example, with &lsqb;0°, 360°)&colon; 370° &hyphen;&gt; 10°, &hyphen;10° &hyphen;&gt; 350°&period;&rsqb;

== Member Functions

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

== Data Members

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


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