5 Quantities and units library [quantities]

5.6 Quantity [qty]

5.6.6 Conversions [qty.conv]

template<UnitCompatibleWith<unit, quantity_spec> ToU> requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, ToU{}), Rep>> constexpr QuantityOf<quantity_spec> auto in(ToU) const;
Effects: Equivalent to: return quantity<make-reference(quantity_spec, ToU{}), Rep>{*this};
template<RepresentationOf<quantity_spec> ToRep> requires QuantityConvertibleTo<quantity, quantity<reference, ToRep>> constexpr QuantityOf<quantity_spec> auto in() const;
Effects: Equivalent to: return quantity<reference, ToRep>{*this};
template<RepresentationOf<quantity_spec> ToRep, UnitCompatibleWith<unit, quantity_spec> ToU> requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, ToU{}), ToRep>> constexpr QuantityOf<quantity_spec> auto in(ToU) const;
Effects: Equivalent to: return quantity<make-reference(quantity_spec, ToU{}), ToRep>{*this};
template<UnitCompatibleWith<unit, quantity_spec> ToU> requires requires(const quantity q) { value_cast<ToU{}>(q); } constexpr QuantityOf<quantity_spec> auto force_in(ToU) const;
Effects: Equivalent to: return value_cast<ToU{}>(*this);
template<RepresentationOf<quantity_spec> ToRep> requires requires(const quantity q) { value_cast<ToRep>(q); } constexpr QuantityOf<quantity_spec> auto force_in() const;
Effects: Equivalent to: return value_cast<ToRep>(*this);
template<RepresentationOf<quantity_spec> ToRep, UnitCompatibleWith<unit, quantity_spec> ToU> requires requires(const quantity q) { value_cast<ToU{}, ToRep>(q); } constexpr QuantityOf<quantity_spec> auto force_in(ToU) const;
Effects: Equivalent to: return value_cast<ToU{}, ToRep>(*this);