[#mp_units-operator_slash-0a] = xref:mp_units.adoc[mp_units]::operator/ :relfileprefix: ../ :mrdocs: Division operators == Synopses Declared in `<mp‐units/framework/dimension.h>` Divides a unit by a reference [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<xref:mp_units/Unit.adoc[Unit] U1> [[nodiscard]] consteval /* implementation-defined */ xref:mp_units/operator_slash-0d6.adoc[operator/]( U1 u1, xref:mp_units/reference-0b2.adoc[reference] r); ---- [.small]#xref:mp_units/operator_slash-0d6.adoc[_» more..._]# Divides a reference by a unit [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<xref:mp_units/Unit.adoc[Unit] U2> [[nodiscard]] consteval /* implementation-defined */ xref:mp_units/operator_slash-0e.adoc[operator/]( xref:mp_units/reference-0b2.adoc[reference] r, U2 u2); ---- [.small]#xref:mp_units/operator_slash-0e.adoc[_» more..._]# `scaled_unit` specializations have priority in this operation. This means that the library framework prevents passing it as an element to the `derived_unit`. In such case only the reference unit is passed to the derived unit and the magnitude remains outside forming another scaled unit as a result of the operation. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< xref:mp_units/Dimension.adoc[Dimension] Lhs, xref:mp_units/Dimension.adoc[Dimension] Rhs> [[nodiscard]] consteval xref:mp_units/Dimension.adoc[Dimension] auto xref:mp_units/operator_slash-03c.adoc[operator/]( Lhs lhs, Rhs rhs); ---- [.small]#xref:mp_units/operator_slash-03c.adoc[_» more..._]# `scaled_unit` specializations have priority in this operation. This means that the library framework prevents passing it as an element to the `derived_unit`. In such case only the reference unit is passed to the derived unit and the magnitude remains outside forming another scaled unit as a result of the operation. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< xref:mp_units/Dimension.adoc[Dimension] Lhs, xref:mp_units/Dimension.adoc[Dimension] Rhs> [[nodiscard]] consteval xref:mp_units/Dimension.adoc[Dimension] auto xref:mp_units/operator_slash-01be.adoc[operator/]( Lhs lhs, Rhs rhs); ---- [.small]#xref:mp_units/operator_slash-01be.adoc[_» more..._]# `scaled_unit` specializations have priority in this operation. This means that the library framework prevents passing it as an element to the `derived_unit`. In such case only the reference unit is passed to the derived unit and the magnitude remains outside forming another scaled unit as a result of the operation. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< xref:mp_units/Dimension.adoc[Dimension] Lhs, xref:mp_units/Dimension.adoc[Dimension] Rhs> [[nodiscard]] consteval xref:mp_units/Dimension.adoc[Dimension] auto xref:mp_units/operator_slash-09.adoc[operator/]( Lhs lhs, Rhs rhs); ---- [.small]#xref:mp_units/operator_slash-09.adoc[_» more..._]# Deleted overload rejecting `reference / quantity`, which has no defined meaning [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< xref:mp_units/Reference-0ba.adoc[Reference] R, typename Q> requires Quantity<std::remove_cvref_t<Q>> constexpr auto xref:mp_units/operator_slash-01b6.adoc[operator/]( R r, Q&& q) = delete; ---- [.small]#xref:mp_units/operator_slash-01b6.adoc[_» more..._]# Deleted overload rejecting `reference / representation`, which has no defined meaning [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< xref:mp_units/Reference-0ba.adoc[Reference] R, typename Rep> requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})> constexpr auto xref:mp_units/operator_slash-04b.adoc[operator/]( R r, Rep&& rep) = delete; ---- [.small]#xref:mp_units/operator_slash-04b.adoc[_» more..._]# Divides a reference by another reference [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Q2, typename U2> [[nodiscard]] consteval /* implementation-defined */ xref:mp_units/operator_slash-0d3.adoc[operator/]( xref:mp_units/reference-0b2.adoc[reference] r1, xref:mp_units/reference-0b2.adoc[reference<Q2, U2>] r2); ---- [.small]#xref:mp_units/operator_slash-0d3.adoc[_» more..._]# Division operator [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Value, auto R1, typename Rep1> requires (!Quantity<Value>) && (!Reference<Value>) && ScalableResultOf<get_quantity_spec(one / R1), std::divides<>, const Value&, Rep1> [[nodiscard]] constexpr xref:mp_units/Quantity-0c.adoc[Quantity] auto xref:mp_units/operator_slash-03b.adoc[operator/]( Value const& val, xref:mp_units/quantity-01.adoc[quantity<R1, Rep1>] const& q); ---- [.small]#xref:mp_units/operator_slash-03b.adoc[_» more..._]# Division operator [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< auto R1, typename Rep1, typename Value> requires (!Quantity<Value>) && (!Reference<Value>) && InvokeResultOf<get_quantity_spec(R1), std::divides<>, Rep1, const Value&> [[nodiscard]] constexpr xref:mp_units/QuantityOf.adoc[QuantityOf<get_quantity_spec(R1)>] auto xref:mp_units/operator_slash-0b.adoc[operator/]( xref:mp_units/quantity-01.adoc[quantity<R1, Rep1>] const& q, Value const& val); ---- [.small]#xref:mp_units/operator_slash-0b.adoc[_» more..._]# Rebinds a quantity to a reference obtained by dividing its own reference by `R` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename FwdQ, xref:mp_units/Reference-0ba.adoc[Reference] R, xref:mp_units/Quantity-0c.adoc[Quantity] Q = std::remove_cvref_t<FwdQ>> [[nodiscard]] constexpr xref:mp_units/Quantity-0c.adoc[Quantity] auto xref:mp_units/operator_slash-08.adoc[operator/]( FwdQ&& q, R r); ---- [.small]#xref:mp_units/operator_slash-08.adoc[_» more..._]# Constructs a quantity from a representation value and the inverse of a reference [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename FwdRep, xref:mp_units/Reference-0ba.adoc[Reference] R, xref:mp_units/RepresentationOf.adoc[RepresentationOf<get_quantity_spec(R{})>] Rep = std::remove_cvref_t<FwdRep>> requires (!detail::OffsetUnit<decltype(get_unit(R{}))>) [[nodiscard]] constexpr xref:mp_units/Quantity-0c.adoc[Quantity] auto xref:mp_units/operator_slash-06.adoc[operator/]( FwdRep&& lhs, R r); ---- [.small]#xref:mp_units/operator_slash-06.adoc[_» more..._]# Deprecated constructor of a quantity from a representation value and the inverse of an offset‐unit reference [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename FwdRep, xref:mp_units/Reference-0ba.adoc[Reference] R, xref:mp_units/RepresentationOf.adoc[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 xref:mp_units/operator_slash-0c.adoc[operator/]( FwdRep&& lhs, R r); ---- [.small]#xref:mp_units/operator_slash-0c.adoc[_» more..._]# Division operator [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< auto R1, typename Rep1, auto R2, typename Rep2> requires InvocableQuantities<std::divides<>, quantity<R1, Rep1>, quantity<R2, Rep2>> [[nodiscard]] constexpr xref:mp_units/Quantity-0c.adoc[Quantity] auto xref:mp_units/operator_slash-04d.adoc[operator/]( xref:mp_units/quantity-01.adoc[quantity<R1, Rep1>] const& lhs, xref:mp_units/quantity-01.adoc[quantity<R2, Rep2>] const& rhs); ---- [.small]#xref:mp_units/operator_slash-04d.adoc[_» more..._]# == 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 reference `Q::reference / R{}` * quantity of the inverse of reference `r` holding the value of `lhs` == Parameters [cols="1,4"] |=== | Name| Description | *u1* | the unit to divide | *r* | the reference to divide by | *u2* | the unit to divide by | *q* | quantity operand (unused) | *rep* | representation operand (unused) | *r1* | the reference to divide | *r2* | the reference to divide by | *lhs* | representation value to become the quantity's numerical value |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#