mp_units::get_common_quantity_spec

get_common_quantity_spec overloads

Synopses

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

Returns the common quantity specification of a single quantity specification

[[nodiscard]]
consteval
QuantitySpec auto
get_common_quantity_spec(auto q);
» more...

Returns the common quantity specification of two quantity specifications

template<
    QuantitySpec Q1,
    QuantitySpec Q2>
requires (detail::have_common_quantity_spec(Q1{}, Q2{}))
[[nodiscard]]
consteval
QuantitySpec auto
get_common_quantity_spec(
    Q1 q1,
    Q2 q2);
» more...

Returns the common quantity specification of three or more quantity specifications

[[nodiscard]]
consteval
QuantitySpec auto
get_common_quantity_spec(
    auto q1,
    auto q2,
    auto q3,
    auto... rest)
requires requires { mp_units::get_common_quantity_spec(mp_units::get_common_quantity_spec(q1, q2), q3, rest...); };
» more...

Return Value

  • q unchanged
  • the strongest quantity specification that both arguments are convertible to
  • the common quantity specification obtained by folding all arguments pairwise

NOTE

The return value should not be discarded.

Template Parameters

NameDescription
Q1first quantity specification type
Q2second quantity specification type

Parameters

NameDescription
qa quantity specification value
q1first quantity specification value
q2second quantity specification value
q3third quantity specification value
restany remaining quantity specification values