mp_units::get_common_unit

Computes the common unit of two common_unit compounds by merging their unit lists

Synopsis

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

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);

Return Value

the common unit obtained by merging the unit lists of cu1 and cu2

NOTE

The return value should not be discarded.

Parameters

NameDescription
cu1first common_unit compound
cu2second common_unit compound