Returns the common unit of two or more units usable as a reference

Synopsis

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

template<
    Reference R1,
    Reference R2,
    Reference... Rest>
[[nodiscard]]
consteval
Reference auto
get_common_reference(
    auto u1,
    auto u2,
    auto... rest)
requires (!(Unit<R1> && Unit<R2> && (... && Unit<Rest>))) && requires {
    mp_units::get_common_quantity_spec(get_quantity_spec(r1), get_quantity_spec(r2), get_quantity_spec(rest)...);
    mp_units::get_common_unit(get_unit(r1), get_unit(r2), get_unit(rest)...);
  };

Return Value

the common unit of all the arguments

Note

The return value should not be discarded.

Parameters

Name

Description

u1

first unit

u2

second unit

rest

any remaining units

Created with MrDocs