Subclause | Module | ||
Utilities | mp_units.core | ||
Reference | |||
Representation | |||
Quantity | |||
Quantity point | |||
Systems | mp_units.systems | ||
std::chrono interoperability |
template<typename T, template<see below> typename U>
consteval bool is-specialization-of(); // exposition only
template<typename T, template<see below> typename U>
consteval bool is-derived-from-specialization-of(); // exposition only
consteval ratio(std::intmax_t n, std::intmax_t d = 1);
friend consteval ratio operator*(ratio lhs, ratio rhs);
consteval ratio common-ratio(ratio r1, ratio r2);
constexpr symbol_text(char portable);
consteval symbol_text(const char (&portable)[N + 1]);
constexpr symbol_text(const std::fixed_string<N>& portable);
consteval symbol_text(const char8_t (&utf8)[N + 1], const char (&portable)[M + 1]);
constexpr symbol_text(const std::fixed_u8string<N>& utf8, const std::fixed_string<M>& portable);
template<std::size_t N2, std::size_t M2>
friend constexpr symbol_text<N + N2, M + M2> operator+(const symbol_text& lhs,
const symbol_text<N2, M2>& rhs);
template<std::size_t N2, std::size_t M2>
friend constexpr bool operator==(const symbol_text& lhs,
const symbol_text<N2, M2>& rhs) noexcept;
template<std::size_t N2, std::size_t M2>
friend constexpr auto operator<=>(const symbol_text& lhs,
const symbol_text<N2, M2>& rhs) noexcept;
template<typename T, typename U>
consteval bool type-less-impl(); // exposition only
template<template<typename...> typename To, typename OneType,
template<typename, typename> typename Pred = type-less, typename Lhs, typename Rhs>
consteval auto expr-multiply(Lhs, Rhs); // exposition only
template<template<typename...> typename To, typename OneType,
template<typename, typename> typename Pred = type-less, typename Lhs, typename Rhs>
consteval auto expr-divide(Lhs lhs, Rhs rhs); // exposition only
template<template<typename...> typename To, typename OneType, typename T>
consteval auto expr-invert(T); // exposition only
template<std::intmax_t Num, std::intmax_t Den, template<typename...> typename To,
typename OneType, template<typename, typename> typename Pred = type-less, typename T>
requires(Den != 0)
consteval auto expr-pow(T); // exposition only
template<template<typename> typename Proj, template<typename...> typename To, typename OneType,
template<typename, typename> typename Pred = type-less, typename T>
consteval auto expr-map(T); // exposition only
template<typename T>
concept Dimension = SymbolicConstant<T> && std::derived_from<T, dimension-interface>;
template<typename T>
concept BaseDimension = // exposition only
Dimension<T> && (is-derived-from-specialization-of<T, base_dimension>());
template<typename T, auto D>
concept DimensionOf = Dimension<T> && Dimension<decltype(D)> && (T{} == D);
template<typename T>
concept QuantitySpec = SymbolicConstant<T> && std::derived_from<T, quantity-spec-interface>;
template<typename T>
concept QuantityKindSpec = // exposition only
QuantitySpec<T> && is-specialization-of<T, kind_of_>();
template<typename T>
concept NamedQuantitySpec = // exposition only
QuantitySpec<T> && is-derived-from-specialization-of<T, quantity_spec>() &&
(!QuantityKindSpec<T>);
template<typename T>
concept DerivedQuantitySpec = // exposition only
QuantitySpec<T> &&
(is-specialization-of<T, derived_quantity_spec>() ||
(QuantityKindSpec<T> &&
is-specialization-of<decltype(auto(T::quantity-spec)), derived_quantity_spec>()));
template<auto Child, auto Parent>
concept ChildQuantitySpecOf = (is-child-of(Child, Parent)); // exposition only
template<auto To, auto From>
concept NestedQuantityKindSpecOf = // exposition only
QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> &&
(get_kind(From) != get_kind(To)) && ChildQuantitySpecOf<To, get_kind(From).quantity-spec>;
template<auto From, auto To>
concept QuantitySpecConvertibleTo = // exposition only
QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && implicitly_convertible(From, To);
template<auto From, auto To>
concept QuantitySpecExplicitlyConvertibleTo = // exposition only
QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && explicitly_convertible(From, To);
template<auto From, auto To>
concept QuantitySpecCastableTo = // exposition only
QuantitySpec<decltype(From)> && QuantitySpec<decltype(To)> && castable(From, To);
template<typename T, auto QS>
concept QuantitySpecOf =
QuantitySpec<T> && QuantitySpec<decltype(QS)> && QuantitySpecConvertibleTo<T{}, QS> &&
!NestedQuantityKindSpecOf<T{}, QS> &&
(QuantityKindSpec<T> || !NestedQuantityKindSpecOf<QS, T{}>);
template<typename T>
concept QSProperty = (!QuantitySpec<T>); // exposition only
template<QuantitySpec auto... From, QuantitySpec Q>
consteval QuantitySpec auto clone-kind-of(Q q); // exposition only
template<QuantitySpec Q>
consteval auto remove-kind(Q q); // exposition only
template<QuantitySpec QS, Unit U>
requires(!AssociatedUnit<U>) || UnitOf<U, QS{}>
consteval Reference auto make-reference(QS, U u); // exposition only
template<QuantitySpec Lhs, QuantitySpec Rhs>
friend consteval QuantitySpec auto operator*(Lhs lhs, Rhs rhs);
template<QuantitySpec Lhs, QuantitySpec Rhs>
friend consteval QuantitySpec auto operator/(Lhs lhs, Rhs rhs);
template<QuantitySpec Lhs, QuantitySpec Rhs>
friend consteval bool operator==(Lhs, Rhs);
consteval QuantitySpec auto inverse(QuantitySpec auto q);
template<std::intmax_t Num, std::intmax_t Den = 1, QuantitySpec Q>
requires(Den != 0)
consteval QuantitySpec auto pow(Q q);
consteval QuantitySpec auto sqrt(QuantitySpec auto q);
consteval QuantitySpec auto cbrt(QuantitySpec auto q);
consteval bool implicitly_convertible(QuantitySpec auto from, QuantitySpec auto to);
consteval bool explicitly_convertible(QuantitySpec auto from, QuantitySpec auto to);
consteval bool castable(QuantitySpec auto from, QuantitySpec auto to);
consteval bool interconvertible(QuantitySpec auto qs1, QuantitySpec auto qs2);
template<QuantitySpec Q>
consteval QuantitySpec auto get-kind-tree-root(Q q); // exposition only
template<QuantitySpec Q>
consteval QuantityKindSpec auto get_kind(Q);
consteval QuantitySpec auto get_common_quantity_spec(QuantitySpec auto... qs)
requires see below;
template<QuantitySpec auto A, QuantitySpec auto B>
consteval auto get-common-base(); // exposition only
template<QuantitySpec Child, QuantitySpec Parent>
consteval bool is-child-of(Child ch, Parent p); // exposition only
template<typename T>
concept MagConstant = SymbolicConstant<T> && is-derived-from-specialization-of<T, mag_constant>();
template<typename T>
concept UnitMagnitude = (is-specialization-of<T, unit-magnitude>());
template<typename T>
concept MagArg = std::integral<T> || MagConstant<T>; // exposition only
template<UnitMagnitude M>
friend consteval UnitMagnitude auto operator*(unit-magnitude lhs, M rhs);
friend consteval auto operator/(unit-magnitude lhs, UnitMagnitude auto rhs);
template<UnitMagnitude Rhs>
friend consteval bool operator==(unit-magnitude, Rhs);
template<int Num, int Den = 1>
friend consteval auto pow(unit-magnitude base); // exposition only
template<MagArg auto V>
constexpr UnitMagnitude auto mag = see below;
template<std::intmax_t N, std::intmax_t D>
requires(N > 0)
constexpr UnitMagnitude auto mag_ratio = see below;
template<MagArg auto Base, int Num, int Den = 1>
constexpr UnitMagnitude auto mag_power = pow<Num, Den>(mag<Base>);
friend consteval bool is-positive-integral-power(unit-magnitude x); // exposition only
template<auto... Ms2>
friend consteval auto common-magnitude(unit-magnitude, unit-magnitude<Ms2...>); // exposition only
template<typename T>
concept Unit = SymbolicConstant<T> && std::derived_from<T, unit-interface>;
template<typename T>
concept PrefixableUnit = Unit<T> && is-derived-from-specialization-of<T, named_unit>();
template<typename T>
concept AssociatedUnit = Unit<U> && has-associated-quantity(U{});
template<typename U, auto QS>
concept UnitOf = AssociatedUnit<U> && QuantitySpec<decltype(QS)> &&
QuantitySpecConvertibleTo<get_quantity_spec(U{}), QS> &&
(get_kind(QS) == get_kind(get_quantity_spec(U{})) ||
!NestedQuantityKindSpecOf<get_quantity_spec(U{}), QS>);
template<auto From, auto To>
concept UnitConvertibleTo = // exposition only
Unit<decltype(From)> && Unit<decltype(To)> && (convertible(From, To));
template<typename U, auto FromU, auto QS>
concept UnitCompatibleWith = // exposition only
Unit<U> && Unit<decltype(FromU)> && QuantitySpec<decltype(QS)> &&
(!AssociatedUnit<U> || UnitOf<U, QS>) && UnitConvertibleTo<FromU, U{}>;
template<typename T>
concept OffsetUnit = Unit<T> && requires { T::point-origin; }; // exposition only
template<typename From, typename To>
concept PotentiallyConvertibleTo = // exposition only
Unit<From> && Unit<To> &&
((AssociatedUnit<From> && AssociatedUnit<To> &&
implicitly_convertible(get_quantity_spec(From{}), get_quantity_spec(To{}))) ||
(!AssociatedUnit<From> && !AssociatedUnit<To>));
template<UnitMagnitude M, Unit U>
friend consteval Unit auto operator*(M, U u);
friend consteval Unit auto operator*(Unit auto, UnitMagnitude auto) = delete;
template<UnitMagnitude M, Unit U>
friend consteval Unit auto operator/(M mag, U u);
consteval QuantitySpec auto get_quantity_spec(AssociatedUnit auto u);
consteval Unit auto get_unit(AssociatedUnit auto u);
template<AssociatedUnit U>
consteval auto get-associated-quantity(U u); // exposition only
template<typename T>
concept Reference = AssociatedUnit<T> || (is-specialization-of<T, reference>());
template<typename T, auto QS>
concept ReferenceOf = Reference<T> && QuantitySpecOf<decltype(get_quantity_spec(T{})), QS>;
template<typename FwdRep, Reference R,
RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>>
requires(!OffsetUnit<decltype(get_unit(R{}))>)
constexpr quantity<R{}, Rep> operator*(FwdRep&& lhs, R r);
template<typename FwdRep, Reference R,
RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>>
requires(!OffsetUnit<decltype(get_unit(R{}))>)
constexpr Quantity auto operator/(FwdRep&& lhs, R);
template<Reference R, typename Rep>
requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})>
constexpr auto operator*(R, Rep&&) = delete;
template<Reference R, typename Rep>
requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})>
constexpr auto operator/(R, Rep&&) = delete;
template<Reference R, typename Q>
requires Quantity<std::remove_cvref_t<Q>>
constexpr auto operator*(R, Q&&) = delete;
template<Reference R, typename Q>
requires Quantity<std::remove_cvref_t<Q>>
constexpr auto operator/(R, Q&&) = delete;
template<typename Q2, typename U2>
friend consteval bool operator==(reference, reference<Q2, U2>);
template<AssociatedUnit U2>
friend consteval bool operator==(reference, U2 u2);
template<typename Q2, typename U2>
friend consteval bool convertible(reference, reference<Q2, U2>);
template<AssociatedUnit U2>
friend consteval bool convertible(reference, U2 u2);
template<AssociatedUnit U1>
friend consteval bool convertible(U1 u1, reference);
template<typename Q, typename U>
consteval QuantitySpec auto get_quantity_spec(reference<Q, U>);
consteval AssociatedUnit auto get_common_reference(AssociatedUnit auto u1,
AssociatedUnit auto u2,
AssociatedUnit auto... rest)
requires see below;
template<typename T>
struct actual-value-type : cond-value-type<T> {}; // see N4971, [readable.traits]
template<typename T>
requires(!std::is_pointer_v<T> && !std::is_array_v<T>) &&
requires { typename std::indirectly_readable_traits<T>::value_type; }
struct actual-value-type<T> : std::indirectly_readable_traits<T> {};
template<typename T>
using actual-value-type-t = actual-value-type<T>::value_type;
template<typename Rep>
constexpr bool treat_as_floating_point =
std::chrono::treat_as_floating_point_v<actual-value-type-t<Rep>>;
template<typename T>
constexpr bool disable_scalar = false;
template<typename T>
constexpr bool disable_complex = false;
template<typename T>
constexpr bool disable_vector = false;
static constexpr Rep one() noexcept;
template<typename T>
concept WeaklyRegular = std::copyable<T> && std::equality_comparable<T>; // exposition only
template<typename T>
concept Scalar = (!disable_scalar<T>) && WeaklyRegular<T> && requires(T a, T b) { // exposition only
// scalar operations
{ -a } -> std::common_with<T>;
{ a + b } -> std::common_with<T>;
{ a - b } -> std::common_with<T>;
{ a * b } -> std::common_with<T>;
{ a / b } -> std::common_with<T>;
};
template<typename T>
using value-type-t = actual-value-type-t<T>; // exposition only, see [qty.fp.traits]
template<typename T>
concept Complex = // exposition only
(!disable_complex<T>) && WeaklyRegular<T> && Scalar<value-type-t<T>> &&
std::constructible_from<T, value-type-t<T>, value-type-t<T>> &&
requires(T a, T b, value-type-t<T> s) {
// complex operations
{ -a } -> std::common_with<T>;
{ a + b } -> std::common_with<T>;
{ a - b } -> std::common_with<T>;
{ a * b } -> std::common_with<T>;
{ a / b } -> std::common_with<T>;
{ a * s } -> std::common_with<T>;
{ s * a } -> std::common_with<T>;
{ a / s } -> std::common_with<T>;
::mp_units::real(a);
::mp_units::imag(a);
::mp_units::modulus(a);
};
template<typename T>
concept Vector = // exposition only
(!disable_vector<T>) && WeaklyRegular<T> && Scalar<value-type-t<T>> &&
requires(T a, T b, value-type-t<T> s) {
// vector operations
{ -a } -> std::common_with<T>;
{ a + b } -> std::common_with<T>;
{ a - b } -> std::common_with<T>;
{ a * s } -> std::common_with<T>;
{ s * a } -> std::common_with<T>;
{ a / s } -> std::common_with<T>;
::mp_units::magnitude(a);
};
template<typename T>
using scaling-factor-type-t = // exposition only
std::conditional_t<treat_as_floating_point<T>, long double, std::intmax_t>;
template<typename T>
concept ScalarRepresentation = // exposition only
(!is-specialization-of<T, quantity>()) && Scalar<T> &&
requires(T a, T b, scaling-factor-type-t<T> f) {
// scaling
{ a * f } -> std::common_with<T>;
{ f * a } -> std::common_with<T>;
{ a / f } -> std::common_with<T>;
};
template<typename T>
concept ComplexRepresentation = // exposition only
(!is-specialization-of<T, quantity>()) && Complex<T> &&
requires(T a, T b, scaling-factor-type-t<T> f) {
// scaling
{ a * T(f) } -> std::common_with<T>;
{ T(f) * a } -> std::common_with<T>;
{ a / T(f) } -> std::common_with<T>;
};
template<typename T>
concept Representation = ScalarRepresentation<T> || ComplexRepresentation<T> ||
VectorRepresentation<T>;
template<typename T, quantity_character Ch>
concept IsOfCharacter = (Ch == quantity_character::real_scalar && Scalar<T>) || // exposition only
(Ch == quantity_character::complex_scalar && Complex<T>) ||
(Ch == quantity_character::vector && Vector<T>);
template<typename T, auto V>
concept RepresentationOf =
Representation<T> && ((QuantitySpec<decltype(V)> &&
(QuantityKindSpec<decltype(V)> || IsOfCharacter<T, V.character>)) ||
(std::same_as<quantity_character, decltype(V)> && IsOfCharacter<T, V>));
template<typename T, template<typename> typename Traits>
concept qty-like-impl = requires(const T& qty, const Traits<T>::rep& num) { // exposition only
{ Traits<T>::to_numerical_value(qty) } -> std::same_as<typename Traits<T>::rep>;
{ Traits<T>::from_numerical_value(num) } -> std::same_as<T>;
requires std::same_as<decltype(Traits<T>::explicit_import), const bool>;
requires std::same_as<decltype(Traits<T>::explicit_export), const bool>;
typename std::bool_constant<Traits<T>::explicit_import>;
typename std::bool_constant<Traits<T>::explicit_export>;
};
template<typename T>
concept QuantityLike = !Quantity<T> && qty-like-impl<T, quantity_like_traits> && requires {
typename quantity<quantity_like_traits<T>::reference, typename quantity_like_traits<T>::rep>;
};
static constexpr quantity zero() noexcept
requires see below;
static constexpr quantity one() noexcept
requires see below;
static constexpr quantity min() noexcept
requires see below;
static constexpr quantity max() noexcept
requires see below;
template<QuantityLike Q>
requires QuantityConvertibleTo<quantity-like-type<Q>, quantity>
constexpr explicit(see below) quantity(const Q& q);
template<UnitCompatibleWith<unit, quantity_spec> ToU>
requires QuantityConvertibleTo<quantity, quantity<make-reference(quantity_spec, ToU{}), Rep>>
constexpr QuantityOf<quantity_spec> auto in(ToU) const;
template<RepresentationOf<quantity_spec> ToRep>
requires QuantityConvertibleTo<quantity, quantity<reference, ToRep>>
constexpr QuantityOf<quantity_spec> auto in() const;
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;
template<UnitCompatibleWith<unit, quantity_spec> ToU>
requires requires(const quantity q) { value_cast<ToU{}>(q); }
constexpr QuantityOf<quantity_spec> auto force_in(ToU) const;
template<RepresentationOf<quantity_spec> ToRep>
requires requires(const quantity q) { value_cast<ToRep>(q); }
constexpr QuantityOf<quantity_spec> auto force_in() const;
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;
template<typename V_, std::constructible_from<Rep> Value = std::remove_cvref_t<V_>>
requires(unit == ::mp_units::one)
explicit operator V_() const & noexcept;
template<typename Q_, QuantityLike Q = std::remove_cvref_t<Q_>>
requires QuantityConvertibleTo<quantity, quantity-like-type<Q>>
constexpr explicit(see below) operator Q_() const noexcept(see below);
constexpr QuantityOf<quantity_spec> auto operator+() const
requires see below;
constexpr QuantityOf<quantity_spec> auto operator-() const
requires see below;
constexpr QuantityOf<quantity_spec> auto operator++(int)
requires see below;
constexpr QuantityOf<quantity_spec> auto operator--(int)
requires see below;
template<Mutable<quantity> Q, auto R2, typename Rep2>
requires see below
friend constexpr decltype(auto) operator+=(Q&& lhs, const quantity<R2, Rep2>& rhs);
template<Mutable<quantity> Q, auto R2, typename Rep2>
requires see below
friend constexpr decltype(auto) operator-=(Q&& lhs, const quantity<R2, Rep2>& rhs);
template<Mutable<quantity> Q, auto R2, typename Rep2>
requires see below
friend constexpr decltype(auto) operator%=(Q&& lhs, const quantity<R2, Rep2>& rhs);
template<Mutable<quantity> Q, QuantityOf<dimensionless> Q2>
requires see below
friend constexpr decltype(auto) operator*=(Q&& lhs, const Q2& rhs);
template<Mutable<quantity> Q, QuantityOf<dimensionless> Q2>
requires see below
friend constexpr decltype(auto) operator/=(Q&& lhs, const Q2& rhs);
template<std::derived_from<quantity> Q, auto R2, typename Rep2>
requires CommonlyInvocableQuantities<std::plus<>, quantity, quantity<R2, Rep2>>
friend constexpr Quantity auto operator+(const Q& lhs, const quantity<R2, Rep2>& rhs);
template<std::derived_from<quantity> Q, auto R2, typename Rep2>
requires CommonlyInvocableQuantities<std::minus<>, quantity, quantity<R2, Rep2>>
friend constexpr Quantity auto operator-(const Q& lhs, const quantity<R2, Rep2>& rhs);
template<std::derived_from<quantity> Q, auto R2, typename Rep2>
requires(!treat_as_floating_point<Rep>) && (!treat_as_floating_point<Rep2>) &&
CommonlyInvocableQuantities<std::modulus<>, quantity, quantity<R2, Rep2>>
friend constexpr Quantity auto operator%(const Q& lhs, const quantity<R2, Rep2>& rhs);
template<std::derived_from<quantity> Q, Representation Value>
requires(Q::unit == ::mp_units::one) &&
InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&>
friend constexpr Quantity auto operator+(const Q& lhs, const Value& rhs);
template<std::derived_from<quantity> Q, Representation Value>
requires(Q::unit == ::mp_units::one) &&
InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&>
friend constexpr Quantity auto operator-(const Q& lhs, const Value& rhs);
template<std::derived_from<quantity> Q, Representation Value>
requires(Q::unit == ::mp_units::one) &&
InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&>
friend constexpr Quantity auto operator%(const Q& lhs, const Value& rhs);
template<std::derived_from<quantity> Q, Representation Value>
requires(Q::unit == ::mp_units::one) &&
InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&>
friend constexpr Quantity auto operator+(const Value& lhs, const Q& rhs);
template<std::derived_from<quantity> Q, Representation Value>
requires(Q::unit == ::mp_units::one) &&
InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&>
friend constexpr Quantity auto operator-(const Value& lhs, const Q& rhs);
template<std::derived_from<quantity> Q, Representation Value>
requires(Q::unit == ::mp_units::one) &&
InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&>
friend constexpr Quantity auto operator%(const Value& lhs, const Q& rhs);
template<std::derived_from<quantity> Q, auto R2, typename Rep2>
requires InvocableQuantities<std::multiplies<>, quantity, quantity<R2, Rep2>>
friend constexpr Quantity auto operator*(const Q& lhs, const quantity<R2, Rep2>& rhs);
template<std::derived_from<quantity> Q, auto R2, typename Rep2>
requires InvocableQuantities<std::divides<>, quantity, quantity<R2, Rep2>>
friend constexpr Quantity auto operator/(const Q& lhs, const quantity<R2, Rep2>& rhs);
template<std::derived_from<quantity> Q, typename Value>
requires(!Quantity<Value>) && (!Reference<Value>) &&
InvokeResultOf<quantity_spec, std::multiplies<>, Rep, const Value&>
friend constexpr QuantityOf<quantity_spec> auto operator*(const Q& lhs, const Value& rhs);
template<std::derived_from<quantity> Q, typename Value>
requires(!Quantity<Value>) && (!Reference<Value>) &&
InvokeResultOf<quantity_spec, std::divides<>, Rep, const Value&>
friend constexpr QuantityOf<quantity_spec> auto operator/(const Q& lhs, const Value& rhs);
template<typename Value, std::derived_from<quantity> Q>
requires(!Quantity<Value>) && (!Reference<Value>) &&
InvokeResultOf<quantity_spec, std::multiplies<>, const Value&, Rep>
friend constexpr QuantityOf<quantity_spec> auto operator*(const Value& lhs, const Q& rhs);
template<typename Value, std::derived_from<quantity> Q>
requires(!Quantity<Value>) && (!Reference<Value>) &&
InvokeResultOf<quantity_spec, std::divides<>, const Value&, Rep>
friend constexpr Quantity auto operator/(const Value& lhs, const Q& rhs);
template<std::derived_from<quantity> Q, auto R2, typename Rep2>
requires see below
friend constexpr bool operator==(const Q& lhs, const quantity<R2, Rep2>& rhs);
template<std::derived_from<quantity> Q, auto R2, typename Rep2>
requires see below
friend constexpr auto operator<=>(const Q& lhs, const quantity<R2, Rep2>& rhs);
template<std::derived_from<quantity> Q, Representation Value>
requires see below
friend constexpr bool operator==(const Q& lhs, const Value& rhs);
template<std::derived_from<quantity> Q, Representation Value>
requires see below
friend constexpr auto operator<=>(const Q& lhs, const Value& rhs);
friend constexpr bool is_eq_zero(const quantity& q) requires see below;
friend constexpr bool is_neq_zero(const quantity& q) requires see below;
friend constexpr bool is_lt_zero(const quantity& q) requires see below;
friend constexpr bool is_gt_zero(const quantity& q) requires see below;
friend constexpr bool is_lteq_zero(const quantity& q) requires see below;
friend constexpr bool is_gteq_zero(const quantity& q) requires see below;
template<typename FwdRep,
RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>>
constexpr quantity<R{}, Rep> operator()(FwdRep&& lhs) const;
template<Representation ToRep, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>>
requires RepresentationOf<ToRep, Q::quantity_spec> &&
std::constructible_from<ToRep, typename Q::rep>
constexpr quantity<Q::reference, ToRep> value_cast(FwdQ&& q);
template<Unit auto ToU, Representation ToRep, typename FwdQ,
Quantity Q = std::remove_cvref_t<FwdQ>>
requires see below
constexpr Quantity auto value_cast(FwdQ&& q);
template<Representation ToRep, Unit auto ToU, typename FwdQ,
Quantity Q = std::remove_cvref_t<FwdQ>>
requires see below
constexpr Quantity auto value_cast(FwdQ&& q);
template<QuantitySpec auto ToQS, typename FwdQ, Quantity Q = std::remove_cvref_t<FwdQ>>
requires QuantitySpecCastableTo<Q::quantity_spec, ToQS>
constexpr Quantity auto quantity_cast(FwdQ&& q);
template<typename T>
concept PointOrigin = SymbolicConstant<T> && std::derived_from<T, point-origin-interface>;
template<typename T, auto QS>
concept PointOriginFor = PointOrigin<T> && QuantitySpecOf<decltype(QS), T::quantity-spec>;
template<typename T, auto V>
concept SameAbsolutePointOriginAs = // exposition only
PointOrigin<T> && PointOrigin<decltype(V)> && same-absolute-point-origins(T{}, V);
template<PointOrigin PO, typename FwdQ,
QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>>
friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(PO, FwdQ&& q);
template<Quantity FwdQ, PointOrigin PO,
QuantityOf<PO::quantity-spec> Q = std::remove_cvref_t<FwdQ>>
friend constexpr quantity_point<Q::reference, PO{}, typename Q::rep> operator+(FwdQ&& q, PO);
template<PointOrigin PO, Quantity Q>
requires ReferenceOf<decltype(auto(Q::reference)), PO::quantity-spec>
friend constexpr QuantityPoint auto operator-(PO po, const Q& q)
requires requires { -q; };
template<PointOrigin PO1, SameAbsolutePointOriginAs<PO1{}> PO2>
requires see below
friend constexpr Quantity auto operator-(PO1 po1, PO2 po2);
template<PointOrigin PO1, PointOrigin PO2>
friend consteval bool operator==(PO1 po1, PO2 po2);
template<PointOrigin PO1, PointOrigin PO2>
consteval bool same-absolute-point-origins(PO1 po1, PO2 po2); // exposition only
template<Reference R>
consteval PointOriginFor<get_quantity_spec(R{})> auto default_point_origin(R);
template<typename T>
concept QuantityPointLike =
!QuantityPoint<T> &&
qty-like-impl<T, quantity_point_like_traits> && // see [qty.like]
requires {
typename quantity_point<quantity_point_like_traits<T>::reference,
quantity_point_like_traits<T>::point_origin,
typename quantity_point_like_traits<T>::rep>;
};
static constexpr quantity_point min() noexcept
requires see below;
static constexpr quantity_point max() noexcept
requires see below;
template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>>
requires std::constructible_from<quantity_type, FwdQ> &&
(point_origin == default_point_origin(R)) &&
(implicitly_convertible(Q::quantity_spec, quantity_spec))
constexpr explicit quantity_point(FwdQ&& q);
template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>>
requires std::constructible_from<quantity_type, FwdQ>
constexpr quantity_point(FwdQ&& q, decltype(PO));
template<typename FwdQ, PointOrigin PO2,
QuantityOf<PO2::quantity-spec> Q = std::remove_cvref_t<FwdQ>>
requires std::constructible_from<quantity_type, FwdQ> && SameAbsolutePointOriginAs<PO2, PO>
constexpr quantity_point(FwdQ&& q, PO2);
template<QuantityPointOf<absolute_point_origin> QP>
requires std::constructible_from<quantity_type, typename QP::quantity_type>
constexpr explicit(!std::convertible_to<typename QP::quantity_type, quantity_type>)
quantity_point(const QP& qp);
template<QuantityPointLike QP>
requires see below
constexpr explicit(see below) quantity_point(const QP& qp);
template<SameAbsolutePointOriginAs<absolute_point_origin> NewPO>
constexpr QuantityPointOf<(NewPO{})> auto point_for(NewPO new_origin) const;
template<UnitCompatibleWith<unit, quantity_spec> ToU>
requires see below
constexpr QuantityPointOf<quantity_spec> auto in(ToU) const;
template<RepresentationOf<quantity_spec> ToRep>
requires see below
constexpr QuantityPointOf<quantity_spec> auto in() const;
template<RepresentationOf<quantity_spec> ToRep,
UnitCompatibleWith<unit, quantity_spec> ToU>
requires see below
constexpr QuantityPointOf<quantity_spec> auto in(ToU) const;
template<UnitCompatibleWith<unit, quantity_spec> ToU>
requires see below
constexpr QuantityPointOf<quantity_spec> auto force_in(ToU) const;
template<RepresentationOf<quantity_spec> ToRep>
requires see below
constexpr QuantityPointOf<quantity_spec> auto force_in() const;
template<RepresentationOf<quantity_spec> ToRep,
UnitCompatibleWith<unit, quantity_spec> ToU>
requires see below
constexpr QuantityPointOf<quantity_spec> auto force_in(ToU) const;
template<PointOrigin PO2>
requires(PO2{} == point_origin)
constexpr quantity_type& quantity_ref_from(PO2) & noexcept;
template<PointOrigin PO2>
requires(PO2{} == point_origin)
constexpr const quantity_type& quantity_ref_from(PO2) const & noexcept;
template<PointOrigin PO2>
requires requires(const quantity_point qp) { qp - PO2{}; }
constexpr Quantity auto quantity_from(PO2 rhs) const;
template<QuantityPointOf<absolute_point_origin> QP>
constexpr Quantity auto quantity_from(const QP& rhs) const;
template<typename QP_, QuantityPointLike QP = std::remove_cvref_t<QP_>>
requires see below
constexpr explicit(see below) operator QP_() const & noexcept(see below);
template<typename QP_, QuantityPointLike QP = std::remove_cvref_t<QP_>>
requires see below
constexpr explicit(see below) operator QP_() && noexcept(see below);
constexpr quantity_point operator++(int)
requires see below;
constexpr quantity_point operator--(int)
requires see below;
template<Mutable<quantity_point> QP, auto R2, typename Rep2>
requires see below
friend constexpr decltype(auto) operator+=(QP&& qp, const quantity<R2, Rep2>& q);
template<Mutable<quantity_point> QP, auto R2, typename Rep2>
requires see below
friend constexpr decltype(auto) operator-=(QP&& qp, const quantity<R2, Rep2>& q);
template<std::derived_from<quantity_point> QP, auto R2, typename Rep2>
friend constexpr QuantityPoint auto operator+(const QP& qp, const quantity<R2, Rep2>& q)
requires see below;
template<std::derived_from<quantity_point> QP, auto R2, typename Rep2>
friend constexpr QuantityPoint auto operator+(const quantity<R2, Rep2>& q, const QP& qp)
requires see below;
template<std::derived_from<quantity_point> QP, auto R2, typename Rep2>
friend constexpr QuantityPoint auto operator-(const QP& qp, const quantity<R2, Rep2>& q)
requires see below;
template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2>
friend constexpr Quantity auto operator-(const QP& lhs, const QP2& rhs)
requires see below;
template<std::derived_from<quantity_point> QP, PointOrigin PO2>
requires see below
friend constexpr Quantity auto operator-(const QP& qp, PO2 po);
template<std::derived_from<quantity_point> QP, PointOrigin PO2>
requires see below
friend constexpr Quantity auto operator-(PO2 po, const QP& qp);
template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2>
requires see below
friend constexpr bool operator==(const QP& lhs, const QP2& rhs);
template<std::derived_from<quantity_point> QP, QuantityPointOf<absolute_point_origin> QP2>
requires see below
friend constexpr auto operator<=>(const QP& lhs, const QP2& rhs);
template<typename FwdRep,
RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>>
constexpr quantity_point<R{}, default_point_origin(R{}), Rep> operator()(FwdRep&& lhs) const;
template<QuantityPoint ToQP, typename FwdFromQP,
QuantityPoint FromQP = std::remove_cvref_t<FwdFromQP>>
requires see below
constexpr QuantityPoint auto sudo-cast(FwdFromQP&& qp);
template<Unit auto ToU, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires(convertible(QP::reference, ToU))
constexpr QuantityPoint auto value_cast(FwdQP&& qp);
template<Representation ToRep, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires RepresentationOf<ToRep, QP::quantity_spec> &&
std::constructible_from<ToRep, typename QP::rep>
constexpr quantity_point<QP::reference, QP::point_origin, ToRep> value_cast(FwdQP&& qp);
template<Unit auto ToU, Representation ToRep, typename FwdQP,
QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires see below
constexpr QuantityPoint auto value_cast(FwdQP&& qp);
template<Representation ToRep, Unit auto ToU, typename FwdQP,
QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires see below
constexpr QuantityPoint auto value_cast(FwdQP&& qp);
template<Quantity ToQ, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires(convertible(QP::reference, ToQ::unit)) && (ToQ::quantity_spec == QP::quantity_spec) &&
std::constructible_from<typename ToQ::rep, typename QP::rep>
constexpr QuantityPoint auto value_cast(FwdQP&& qp);
template<QuantityPoint ToQP, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires(convertible(QP::reference, ToQP::unit)) &&
(ToQP::quantity_spec == QP::quantity_spec) &&
(same-absolute-point-origins(ToQP::point_origin, QP::point_origin)) &&
std::constructible_from<typename ToQP::rep, typename QP::rep>
constexpr QuantityPoint auto value_cast(FwdQP&& qp);
template<QuantitySpec auto ToQS, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires QuantitySpecCastableTo<QP::quantity_spec, ToQS>
constexpr QuantityPoint auto quantity_cast(FwdQP&& qp);