![]() |
Quantify
An extensible C++ units library
|
Core components of the Quantify library. More...
Exported Modules | |
| module | std |
Concepts | |
| concept | quantify::has_scale |
| Predicate that checks if a type defines a scale for itself. | |
| concept | quantify::Convertible |
| concept | quantify::ConvertibleScales |
| concept | quantify::CompareScales |
| concept | quantify::SameScale |
| concept | quantify::Quantity |
Unit agnostic type concept for use with the auto keyword. | |
| concept | quantify::QuantityConcept |
| Predicate that checks if a type is a quantity regardless of its unit. | |
Classes | |
| struct | quantify::no_scale |
| struct | quantify::no_unit |
| struct | quantify::unit_conversion_t< U_FROM, U_TO, T > |
| struct | quantify::scale_conversion_t< S_FROM, S_TO > |
| struct | quantify::reduce_impl< Expr > |
| struct | quantify::reduce_scale< Scale > |
| struct | quantify::reduce_scale< Scale > |
| struct | quantify::mul< Products > |
| struct | quantify::frac< Numerator, Denominator > |
| struct | quantify::is_mul<... > |
| struct | quantify::is_mul< mul< Args... > > |
| struct | quantify::is_frac<... > |
| struct | quantify::is_frac< frac< Args... > > |
| struct | quantify::quantity< U, T > |
| struct | quantify::mul< Products... > |
| struct | quantify::frac< Numerator, Denominator > |
| struct | quantify::ratio< T, Num, Den > |
| Static representation of a numerical ratio in the form of a fraction. More... | |
Typedefs | |
| template<typename Expr> | |
| using | quantify::reduce = typename reduce_impl<Expr>::type |
| template<typename T> | |
| using | quantify::is_quantity |
| Predicate that checks if a type is a quantity regardless of its unit. | |
| using | scale = mul<typename Products::scale...> |
| template<typename T> | |
| using | factor |
| using | scale = frac<typename Numerator::scale, typename Denominator::scale> |
| template<typename T> | |
| using | factor |
| using | unit = U |
| using | data_type = T |
| template<typename U, typename T> | |
| using | quantify::Q = quantity<U, T> |
Functions | |
| static constexpr std::string | symbol () noexcept |
| static constexpr std::string | symbol () noexcept |
| static constexpr std::string | symbol () noexcept |
| static constexpr std::string | symbol () noexcept |
| static constexpr std::string | symbol () noexcept |
| static constexpr std::string | symbol () noexcept |
| static constexpr std::string | symbol () noexcept |
| static constexpr std::string | symbol () noexcept |
| template<typename N> | |
| quantify::REDUCE_PATTERN (frac< N, N >) TO(no_unit) | |
| template<> | |
| quantify::REDUCE_PATTERN (frac< no_unit, no_unit >) TO(no_unit) | |
| template<typename N> | |
| quantify::REDUCE_PATTERN (frac< N, no_unit >) TO(reduce< N >) | |
| template<typename N, typename D> requires (!is_frac_v<N>) | |
| quantify::REDUCE_PATTERN (frac< N, frac< N, D > >) TO(reduce< D >) | |
| template<typename N, typename D1, typename D2> requires (!is_frac_v<N>) | |
| quantify::REDUCE_PATTERN (frac< N, frac< D1, D2 > >) TO(reduce< frac< reduce< mul< reduce< N > | |
| template<typename N, typename D> | |
| quantify::REDUCE_PATTERN (frac< frac< N, D >, no_unit >) TO(reduce< frac< N | |
| template<typename N, typename D> requires (!is_frac_v<N>) | |
| quantify::REDUCE_PATTERN (frac< frac< N, D >, N >) TO(reduce< frac< no_unit | |
| template<typename N, typename D1, typename D2> requires (!is_frac_v<N>) | |
| quantify::REDUCE_PATTERN (frac< frac< D1, D2 >, N >) TO(reduce< frac< reduce< D1 > | |
| template<typename N1, typename N2, typename D1, typename D2> requires (!std::is_same_v<N1, D1> || !std::is_same_v<N2, D2>) | |
| quantify::REDUCE_PATTERN (frac< frac< N1, N2 >, frac< D1, D2 > >) TO(reduce< frac< reduce< mul< reduce< N1 > | |
| template<typename N, typename ... Ds> requires (packtl::Contains<N, Ds...>) | |
| quantify::REDUCE_PATTERN (frac< N, mul< Ds... > >) TO(reduce< frac< no_unit | |
| template<typename D, typename ... Ns> requires (packtl::Contains<D, Ns...>) | |
| quantify::REDUCE_PATTERN (frac< mul< Ns... >, D >) TO(reduce< cancel_out< reduce< mul< Ns... > > | |
| template<typename M1, typename M2> requires (is_mul_v<M1> && is_mul_v<M2> && !packtl::share_items<M1, M2>::value) | |
| quantify::REDUCE_PATTERN (frac< M1, M2 >) TO(frac< M1 | |
| template<typename M1, typename M2> requires (is_mul_v<M1> && is_mul_v<M2> && packtl::share_items<M1, M2>::value) | |
| quantify::REDUCE_PATTERN (frac< M1, M2 >) TO(reduce< frac< reduce< typename cancel_out_many< M1 | |
| template<> | |
| quantify::REDUCE_PATTERN (mul<>) TO(no_unit) | |
| template<typename P> | |
| quantify::REDUCE_PATTERN (mul< P >) TO(reduce< P >) | |
| template<typename ... Ps> requires (!packtl::Contains<no_unit, Ps...> && ((!is_mul_v<Ps> && !is_frac_v<Ps>) && ...)) | |
| quantify::REDUCE_PATTERN (mul< Ps... >) TO(mul< Ps... >) | |
| template<typename ... Ps> requires (!packtl::Contains<no_unit, Ps...> && ((is_mul_v<Ps> || is_frac_v<Ps>) || ...)) | |
| quantify::REDUCE_PATTERN (mul< Ps... >) TO(reduce< normalize_t< mul< Ps... > > >) | |
| template<typename ... Ps> requires packtl::Contains<no_unit, Ps...> | |
| quantify::REDUCE_PATTERN (mul< Ps... >) TO(reduce< cancel_out< mul< Ps... > | |
| static constexpr std::string | symbol () noexcept |
| static constexpr std::string | symbol () noexcept |
| T | value_as_base_unit () const |
| template<typename U1> requires SameScale<U, U1> | |
| auto | operator<=> (const quantity< U1, T > &rhl) const |
| template<typename U1> requires SameScale<U, U1> | |
| bool | operator< (const quantity< U1, T > &rhl) const |
| template<typename U1> requires SameScale<U, U1> | |
| bool | operator== (const quantity< U1, T > &rhl) const |
| template<typename T1> requires (not QuantityConcept<T1>) | |
| auto | operator<=> (const T1 &rhl) const |
| template<typename T1> requires (not QuantityConcept<T1>) | |
| bool | operator< (const T1 &rhl) const |
| template<typename T1> requires (not QuantityConcept<T1>) | |
| bool | operator== (const T1 &rhl) const |
| template<typename U1> requires SameScale<U, U1> | |
| quantity< R(frac< R(U), R(U)>), T > | operator/ (const quantity< U1, T > &rhl) const |
| template<typename U1> requires (!SameScale<U, U1>) | |
| quantity< R(frac< R(U), R(U1)>), T > | operator/ (const quantity< U1, T > &rhl) const |
| template<typename T1> requires (not QuantityConcept<T1>) | |
| quantity< R(U), T > | operator/ (const T1 &rhl) const |
| template<typename U1> requires SameScale<U, U1> | |
| quantity< R(mul< R(U), R(U)>), T > | operator* (const quantity< U1, T > &rhl) const |
| template<typename U1> requires (!SameScale<U, U1>) | |
| quantity< R(mul< R(U), R(U1)>), T > | operator* (const quantity< U1, T > &rhl) const |
| template<typename T1> requires (not QuantityConcept<T1>) | |
| quantity< R(U), T > | operator* (const T1 &rhl) const |
| template<typename U1, typename T1> requires (SameScale<U, U1>) | |
| quantity< R(U), T1 > | operator+ (const quantity< U1, T1 > &rhl) const |
| template<typename U1, typename T1> requires (SameScale<U, U1>) | |
| quantity< R(U), T1 > & | operator+= (const quantity< U1, T1 > &rhl) |
| template<typename U1, typename T1> requires (SameScale<U, U1>) | |
| quantity< R(U), T1 > | operator- (const quantity< U1, T1 > &rhl) const |
| template<typename U1, typename T1> requires (SameScale<U, U1>) | |
| quantity< R(U), T1 > & | operator-= (const quantity< U1, T1 > &rhl) |
| quantity< U, T > | operator- () const |
| constexpr | quantity ()=default |
| constexpr | quantity (T value_) |
| template<typename T1> | |
| quantity (const quantity< U, T1 > &other) | |
| Copy. | |
| template<typename U1, typename T1> requires ( not std::same_as<R(U), R(U1)> && (SameScale<U, U1> || Convertible<U, U1, T> || ConvertibleScales<typename U::scale, typename U1::scale, U, U1, T>) ) | |
| quantity (const quantity< U1, T1 > &other) | |
| Copy. | |
| template<typename T1> | |
| quantity & | operator= (const quantity< U, T1 > &rhl) |
| Copy. | |
| template<typename U1, typename T1> requires ( not std::same_as<R(U), R(U1)> && (SameScale<U, U1> || Convertible<U, U1, T> || ConvertibleScales<typename U::scale, typename U1::scale, U, U1, T>) ) | |
| quantity & | operator= (const quantity< U1, T1 > &rhl) |
| Copy. | |
| template<typename T1> | |
| quantity (quantity< U, T1 > &&other) noexcept | |
| Move. | |
| template<typename U1, typename T1> requires ( not std::same_as<R(U), R(U1)> && (SameScale<U, U1> || Convertible<U, U1, T> || ConvertibleScales<typename U::scale, typename U1::scale, U, U1, T>) ) | |
| quantity (quantity< U1, T1 > &&other) | |
| Move. | |
| template<typename T1> | |
| quantity & | operator= (quantity< U, T1 > &&rhl) noexcept |
| Move. | |
| template<typename U1, typename T1> requires ( not std::same_as<R(U), R(U1)> && (SameScale<U, U1> || Convertible<U, U1, T> || ConvertibleScales<typename U::scale, typename U1::scale, U, U1, T>) ) | |
| quantity & | operator= (quantity< U1, T1 > &&rhl) |
| Move. | |
| template<typename U1> requires SameScale<U, U1> || Convertible<U, U1, T> || ConvertibleScales<typename U::scale, typename U1::scale, U, U1, T> | |
| constexpr quantity< U1, T > | as () const |
| std::string | to_string () const noexcept |
| template<QuantityConcept Q, typename T1> requires (not QuantityConcept<T1>) | |
| Q | quantify::operator/ (const T1 &lhs, const Q &rhs) |
| template<QuantityConcept Q, typename T1> requires (not QuantityConcept<T1>) | |
| Q | quantify::operator* (const T1 &lhs, const Q &rhs) |
| template<typename U, typename T> | |
| std::ostream & | operator<< (std::ostream &o, const quantify::quantity< U, T > &quantity) |
Variables | |
| template<typename M> | |
| constexpr bool | quantify::is_mul_v = is_mul<M>::value |
| template<typename F> | |
| constexpr bool | quantify::is_frac_v = is_frac<F>::value |
| template<typename S> | |
| constexpr bool | quantify::has_scale_v = has_scale<S> |
| See has_scale. | |
| template<typename T> | |
| constexpr bool | quantify::is_quantity_v = is_quantity<T>::value |
| Predicate that checks if a type is a quantity regardless of its unit. | |
| quantify::reduce< D2 > | |
| quantify::reduce< D1 > | |
| quantify::D | |
| quantify::reduce< D > | |
| quantify::reduce< mul< reduce< D2 >, reduce< N > > > | |
| quantify::reduce< mul< reduce< D1 >, reduce< N2 > > > | |
| quantify::reduce< cancel_out< reduce< mul< Ds... > >, N > > | |
| quantify::M2 | |
| M2 | quantify::reduce< typename cancel_out_many< M2, M1 >::type > |
| quantify::no_unit | |
| static constexpr T | numerator = Num |
| static constexpr T | denominator = Den |
| T | value { } |
Core components of the Quantify library.
Files | |
| file | include/quantify/core/quantify_core.cppm |
| Exports module partitions. | |
| file | include/quantify/core/concepts.cppm |
| file | include/quantify/expressions/frac.cppm |
| file | include/quantify/expressions/mul.cppm |
| file | include/quantify/core/preface.cppm |
| file | include/quantify/core/quantity.cppm |
| file | include/quantify/core/ratio.cppm |
| file | include/quantify/expressions/reduce_rules.cppm |