mp_units::reflect_in_range

Policy that reflects (folds) the value at both boundaries.

Synopsis

Declared in <mp-units/overflow_policies.h>

template<Quantity Q>
struct reflect_in_range;

Description

Values that exceed [min, max]are "bounced back" from the boundary. For example, with -90, 90: 91 -> 89, 180 -> 0, 270 -> -90.

Member Functions

NameDescription
operator() Reflects v into the closed range [min, max].

Data Members

NameDescription
max The upper boundary of the reflection range
min The lower boundary of the reflection range