Computes the common unit of three or more units

Synopsis

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

[[nodiscard]]
consteval
Unit auto
get_common_unit(
    auto u1,
    auto u2,
    auto u3,
    auto... rest)
requires requires { mp_units::get_common_unit(mp_units::get_common_unit(u1, u2), u3, rest...); };

Return Value

the common unit obtained by folding get_common_unit over u1, u2, u3, and rest

Note

The return value should not be discarded.

Parameters

Name

Description

u1

first unit

u2

second unit

u3

third unit

rest

remaining units, if any

Created with MrDocs