mp_units::get_canonical_unit

Computes the canonical form of a unit

Synopsis

Declared in <mp-units/framework/unit_concepts.h>

[[nodiscard]]
consteval
auto
get_canonical_unit(auto u);

Description

The canonical form reduces a unit to its reference unit expressed only in terms of base units together with the unit magnitude needed to reach it, so that units can be compared for compatibility and converted between each other.

Return Value

the canonical form of u

NOTE

The return value should not be discarded.

Parameters

NameDescription
uunit to compute the canonical form of