Division operators
Synopses
Declared in <mp‐units/framework/reference.h>
Divides a unit by a reference
[[nodiscard]]
consteval
/* implementation-defined */
operator/(
U1 u1,
reference r);
Divides a reference by a unit
[[nodiscard]]
consteval
/* implementation-defined */
operator/(
reference r,
U2 u2);
Divides a reference by another reference
[[nodiscard]]
consteval
/* implementation-defined */
operator/(
reference r1,
reference<Q2, U2> r2);
Deleted overload rejecting reference / quantity, which has no defined meaning
template<
Reference R,
typename Q>
requires Quantity<std::remove_cvref_t<Q>>
constexpr
auto
operator/(
R r,
Q&& q) = delete;
Deleted overload rejecting reference / representation, which has no defined meaning
template<
Reference R,
typename Rep>
requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})>
constexpr
auto
operator/(
R r,
Rep&& rep) = delete;
Rebinds a quantity to a reference obtained by dividing its own reference by R
template<
typename FwdQ,
Reference R,
Quantity Q = std::remove_cvref_t<FwdQ>>
[[nodiscard]]
constexpr
Quantity auto
operator/(
FwdQ&& q,
R r);
Constructs a quantity from a representation value and the inverse of a reference
template<
typename FwdRep,
Reference R,
RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>>
requires (!detail::OffsetUnit<decltype(get_unit(R{}))>)
[[nodiscard]]
constexpr
Quantity auto
operator/(
FwdRep&& lhs,
R r);
Deprecated constructor of a quantity from a representation value and the inverse of an offset‐unit reference
template<
typename FwdRep,
Reference R,
RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>>
requires detail::OffsetUnit<decltype(get_unit(R{}))>
[[deprecated("2.3.0: References using offset units (e.g., temperatures) should be constructed with the `delta` or `point` helpers")]]
constexpr
auto
operator/(
FwdRep&& lhs,
R r);
Return Value
-
a reference resulting from dividing the quantity specification and the unit
-
a reference resulting from dividing the quantity specifications and the units
-
quantity holding the same numerical value as
q, with referenceQ::reference / R{} -
quantity of the inverse of reference
rholding the value oflhs
Parameters
Name |
Description |
u1 |
the unit to divide |
r |
the reference to divide by |
u2 |
the unit to divide by |
r1 |
the reference to divide |
r2 |
the reference to divide by |
q |
quantity operand (unused) |
rep |
representation operand (unused) |
lhs |
representation value to become the quantity's numerical value |
Created with MrDocs