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

NameDescription
operator() Wraps v into the half-open range [min, max).]

Data Members

NameDescription
max The upper boundary of the wrapping range (exclusive)
min The lower boundary of the wrapping range (inclusive)