Skip to content

mp_units::utility::uncertain::operator<=>

Comparison of two uncertain values

Synopsis

Declared in <mp-units/utility/uncertain.h>

[[nodiscard]] constexpr auto operator<=>(uncertain const& rhs) const = default;

Description

RealScalar requires std::totally_ordered, so a real scalar representation cannot opt out of ordering. The order is primarily by the central value, with the uncertainty as a tie-breaker, which keeps it total and consistent with equality. It is structural, not statistical: values with overlapping uncertainty intervals still compare as unequal. For interval-aware comparisons use the lower_bound()/upper_bound() observers.

Return Value

The relative order of the objects

Note

The return value should not be discarded.

Parameters

NameDescription
rhsThe right operand