mp_units::is_non_negative

Checks whether a quantity specification is tagged as non-negative

Synopsis

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

template<QuantitySpec Q>
[[nodiscard]]
consteval
bool
is_non_negative(Q q);

Return Value

true if quantities of Q can never hold a negative value

NOTE

The return value should not be discarded.

Template Parameters

NameDescription
Qquantity specification type

Parameters

NameDescription
qquantity specification value