get_common_unit overloads
Declared in <mp-units/framework/reference.h>
Returns the common unit of a single unit
[[nodiscard]]
consteval
Unit auto
get_common_unit(auto u);
» more...
Computes the common unit of a single new unit and a common_unit compound
template<
Unit... Us,
/* implementation-defined */ NewUnit>
[[nodiscard]]
consteval
Unit auto
get_common_unit(
NewUnit nu,
common_unit<Us...> cu);
» more...
Computes the common unit of two convertible units
template<
Unit U1,
/* implementation-defined */ U2>
[[nodiscard]]
consteval
Unit auto
get_common_unit(
U1 u1,
U2 u2);
» more...
Computes the common unit of a common_unit compound and a single new unit
template<
Unit... Us,
/* implementation-defined */ NewUnit>
[[nodiscard]]
consteval
Unit auto
get_common_unit(
common_unit<Us...> cu,
NewUnit new_unit);
» more...
Computes the common unit of two common_unit compounds by merging their unit lists
template<
Unit Front,
Unit... Rest,
Unit... Us>
requires (detail::UnitConvertibleTo<common_unit<Front, Rest...>, common_unit<Us...>{}>)
[[nodiscard]]
consteval
Unit auto
get_common_unit(
common_unit<Front, Rest...> cu1,
common_unit<Us...> cu2);
» more...
Computes the common unit of three or more units
[[nodiscard]]
consteval
Unit auto
get_common_unit(
auto u1,
auto u2,
auto u3,
auto... rest)
requires requires { mp_units::get_common_unit(mp_units::get_common_unit(u1, u2), u3, rest...); };
» more...
u unchangednu into cu's unit listu1 and u2cu1 and cu2get_common_unit over u1, u2, u3, and restThe return value should not be discarded.
| Name | Description |
|---|---|
| u | the unit |
| nu | the single unit |
| cu | the common_unit compound |
| u1 | first unit |
| u2 | second unit |
| new_unit | the new unit to merge into the compound's unit list |
| cu1 | first common_unit compound |
| cu2 | second common_unit compound |
| u3 | third unit |
| rest | remaining units, if any |