inverse overloads

Synopses

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

Computes the inverse of a dimension.

[[nodiscard]]
consteval
Unit auto
inverse(auto d);

Computes the inverse of a reference

[[nodiscard]]
consteval
/* implementation-defined */
inverse(reference r);

Computes the inverse of a quantity in a provided unit

template<
    Unit auto To,
    auto R,
    typename Rep>
[[nodiscard]]
constexpr
Quantity auto
inverse(quantity<R, Rep> const& q)
requires requires {
    representation_values<Rep>::one();
    value_cast<To>(representation_values<Rep>::one() / q);
  };

Return Value

  • dimension_one / d

  • the result of the computation

  • the inverse of q, expressed in unit To

Note

The return value should not be discarded.

Parameters

Name

Description

d

the dimension to invert

r

reference being inverted

q

the quantity to invert

Created with MrDocs