mp_units::interconvertible

Checks whether two quantity specifications are convertible to each other in both directions

Synopsis

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

template<
    QuantitySpec QS1,
    QuantitySpec QS2>
[[nodiscard]]
consteval
bool
interconvertible(
    QS1 qs1,
    QS2 qs2);

Return Value

true if qs1 is implicitly convertible to qs2 and qs2 is implicitly convertible to qs1

NOTE

The return value should not be discarded.

Template Parameters

NameDescription
QS1first quantity specification type
QS2second quantity specification type

Parameters

NameDescription
qs1first quantity specification value
qs2second quantity specification value