Skip to content

mp_units::wrap_to_range

Policy that wraps the value into the half-open range [min, max)].

Synopsis

Declared in <mp-units/overflow_policies.h>

template<Quantity Q>
struct wrap_to_range;

Description

Uses modulo arithmetic to wrap values into the range. Use for periodic/cyclic quantities (angles, time-of-day, etc.). For example, with [0°, 360°)]: 370° -> 10°, -10° -> 350°.

Member Functions

Name
operator()

Data Members

Name
max
min