mp_units::get_common_unit

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

Synopsis

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

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

Return Value

the common unit obtained by merging nu into cu's unit list

NOTE

The return value should not be discarded.

Parameters

NameDescription
nuthe single unit
cuthe common_unit compound