mp_units::get_common_unit

Computes the common unit of two convertible units

Synopsis

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

template<
    Unit U1,
    /* implementation-defined */ U2>
[[nodiscard]]
consteval
Unit auto
get_common_unit(
    U1 u1,
    U2 u2);

Return Value

the common unit of u1 and u2

NOTE

The return value should not be discarded.

Parameters

NameDescription
u1first unit
u2second unit