mp_units::get_common_unit

Computes the common unit of a common_unit compound and a single new unit

Synopsis

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

template<
    Unit... Us,
    /* implementation-defined */ NewUnit>
[[nodiscard]]
consteval
Unit auto
get_common_unit(
    common_unit<Us...> cu,
    NewUnit new_unit);

Return Value

the common unit obtained by merging the new unit into the compound's unit list

NOTE

The return value should not be discarded.

Parameters

NameDescription
cuthe common_unit compound
new_unitthe new unit to merge into the compound's unit list