[#mp_units-quantity_bounds] = xref:mp_units.adoc[mp_units]::quantity_bounds :relfileprefix: ../ :mrdocs: Customization point for providing bounds on a quantity point relative to an origin. == Synopsis Declared in `<mp‐units/framework/customization_points.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<xref:mp_units/PointOrigin.adoc[PointOrigin] auto PO> requires (PO._quantity_spec_.character == quantity_character::real_scalar) inline constexpr auto quantity_bounds = detail::undefined; ---- == Description Users specialize this variable template for point origins (both absolute and relative). The value should be an overflow‐policy object that stores the bounds (e.g. `reflect_in_range`, `clamp_to_range`, `wrap_to_range`). Bounds are always enforced as constraints on `quantity_from(Origin)` — the displacement measured in the frame of the specialized origin. Different origins (including relative ones) may have independent bounds; it is the user's responsibility to keep them consistent when multiple levels of bounds are in use. Example: [,cpp] ---- {.cpp} // Absolute origin: latitude reflects at poles inline constexpr struct equator final : absolute_point_origin {} equator; template<> constexpr auto quantity_bounds = reflect_in_range{-90 * deg, 90 * deg}; // Relative origin: AC controller setpoint — comfort range clamped around 21 °C inline constexpr struct room_reference_temp final : relative_point_origin(21)> {} room_reference_temp; template<> constexpr auto quantity_bounds = clamp_to_range{delta(-3), delta(3)}; ---- == Template Parameters [cols="1,4"] |=== |Name|Description | *PO* | a point origin for which bounds are defined |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#