Quantify
An extensible C++ units library
Loading...
Searching...
No Matches
quantify::quantity< U, T > Struct Template Referenceexport

Public Types

using unit = U
 
using data_type = T
 

Public Member Functions

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>
quantityoperator= (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>) )
quantityoperator= (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>
quantityoperator= (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>) )
quantityoperator= (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
 

Public Attributes

value { }
 

Detailed Description

template<typename U, typename T>
struct quantify::quantity< U, T >

Definition at line 30 of file quantity.cppm.

Constructor & Destructor Documentation

◆ quantity() [1/6]

template<typename U, typename T>
quantify::quantity< U, T >::quantity ( )
constexprexportdefault
+ Here is the caller graph for this function:

◆ quantity() [2/6]

template<typename U, typename T>
quantify::quantity< U, T >::quantity ( T value_)
inlineconstexprexport

Definition at line 144 of file quantity.cppm.

◆ quantity() [3/6]

template<typename U, typename T>
template<typename T1>
quantify::quantity< U, T >::quantity ( const quantity< U, T1 > & other)
inlineexport

Copy.

Definition at line 149 of file quantity.cppm.

+ Here is the call graph for this function:

◆ quantity() [4/6]

template<typename U, typename T>
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>) )
quantify::quantity< U, T >::quantity ( const quantity< U1, T1 > & other)
inlineexport

Copy.

Definition at line 160 of file quantity.cppm.

+ Here is the call graph for this function:

◆ quantity() [5/6]

template<typename U, typename T>
template<typename T1>
quantify::quantity< U, T >::quantity ( quantity< U, T1 > && other)
inlineexportnoexcept

Move.

Definition at line 185 of file quantity.cppm.

+ Here is the call graph for this function:

◆ quantity() [6/6]

template<typename U, typename T>
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>) )
quantify::quantity< U, T >::quantity ( quantity< U1, T1 > && other)
inlineexport

Move.

Definition at line 196 of file quantity.cppm.

+ Here is the call graph for this function:

Member Function Documentation

◆ as()

template<typename U, typename T>
template<typename U1>
requires SameScale<U, U1> || Convertible<U, U1, T> || ConvertibleScales<typename U::scale, typename U1::scale, U, U1, T>
quantity< U1, T > quantify::quantity< U, T >::as ( ) const
inlinenodiscardconstexprexport

Definition at line 223 of file quantity.cppm.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator*() [1/3]

template<typename U, typename T>
template<typename U1>
requires SameScale<U, U1>
quantity< R(mul< R(U), R(U)>), T > quantify::quantity< U, T >::operator* ( const quantity< U1, T > & rhl) const
inlineexport

Definition at line 96 of file quantity.cppm.

+ Here is the call graph for this function:

◆ operator*() [2/3]

template<typename U, typename T>
template<typename U1>
requires (!SameScale<U, U1>)
quantity< R(mul< R(U), R(U1)>), T > quantify::quantity< U, T >::operator* ( const quantity< U1, T > & rhl) const
inlineexport

Definition at line 102 of file quantity.cppm.

+ Here is the call graph for this function:

◆ operator*() [3/3]

template<typename U, typename T>
template<typename T1>
requires (not QuantityConcept<T1>)
quantity< R(U), T > quantify::quantity< U, T >::operator* ( const T1 & rhl) const
inlineexport

Definition at line 108 of file quantity.cppm.

+ Here is the call graph for this function:

◆ operator+()

template<typename U, typename T>
template<typename U1, typename T1>
requires (SameScale<U, U1>)
quantity< R(U), T1 > quantify::quantity< U, T >::operator+ ( const quantity< U1, T1 > & rhl) const
inlineexport

Definition at line 114 of file quantity.cppm.

+ Here is the call graph for this function:

◆ operator+=()

template<typename U, typename T>
template<typename U1, typename T1>
requires (SameScale<U, U1>)
quantity< R(U), T1 > & quantify::quantity< U, T >::operator+= ( const quantity< U1, T1 > & rhl)
inlineexport

Definition at line 120 of file quantity.cppm.

+ Here is the call graph for this function:

◆ operator-() [1/2]

template<typename U, typename T>
quantity< U, T > quantify::quantity< U, T >::operator- ( ) const
inlineexport

Definition at line 138 of file quantity.cppm.

+ Here is the call graph for this function:

◆ operator-() [2/2]

template<typename U, typename T>
template<typename U1, typename T1>
requires (SameScale<U, U1>)
quantity< R(U), T1 > quantify::quantity< U, T >::operator- ( const quantity< U1, T1 > & rhl) const
inlineexport

Definition at line 127 of file quantity.cppm.

+ Here is the call graph for this function:

◆ operator-=()

template<typename U, typename T>
template<typename U1, typename T1>
requires (SameScale<U, U1>)
quantity< R(U), T1 > & quantify::quantity< U, T >::operator-= ( const quantity< U1, T1 > & rhl)
inlineexport

Definition at line 133 of file quantity.cppm.

+ Here is the call graph for this function:

◆ operator/() [1/3]

template<typename U, typename T>
template<typename U1>
requires SameScale<U, U1>
quantity< R(frac< R(U), R(U)>), T > quantify::quantity< U, T >::operator/ ( const quantity< U1, T > & rhl) const
inlineexport

Definition at line 78 of file quantity.cppm.

+ Here is the call graph for this function:

◆ operator/() [2/3]

template<typename U, typename T>
template<typename U1>
requires (!SameScale<U, U1>)
quantity< R(frac< R(U), R(U1)>), T > quantify::quantity< U, T >::operator/ ( const quantity< U1, T > & rhl) const
inlineexport

Definition at line 84 of file quantity.cppm.

+ Here is the call graph for this function:

◆ operator/() [3/3]

template<typename U, typename T>
template<typename T1>
requires (not QuantityConcept<T1>)
quantity< R(U), T > quantify::quantity< U, T >::operator/ ( const T1 & rhl) const
inlineexport

Definition at line 90 of file quantity.cppm.

+ Here is the call graph for this function:

◆ operator<() [1/2]

template<typename U, typename T>
template<typename U1>
requires SameScale<U, U1>
bool quantify::quantity< U, T >::operator< ( const quantity< U1, T > & rhl) const
inlineexport

Definition at line 48 of file quantity.cppm.

+ Here is the call graph for this function:

◆ operator<() [2/2]

template<typename U, typename T>
template<typename T1>
requires (not QuantityConcept<T1>)
bool quantify::quantity< U, T >::operator< ( const T1 & rhl) const
inlineexport

Definition at line 66 of file quantity.cppm.

◆ operator<=>() [1/2]

template<typename U, typename T>
template<typename U1>
requires SameScale<U, U1>
auto quantify::quantity< U, T >::operator<=> ( const quantity< U1, T > & rhl) const
inlineexport

Definition at line 42 of file quantity.cppm.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator<=>() [2/2]

template<typename U, typename T>
template<typename T1>
requires (not QuantityConcept<T1>)
auto quantify::quantity< U, T >::operator<=> ( const T1 & rhl) const
inlineexport

Definition at line 60 of file quantity.cppm.

+ Here is the call graph for this function:

◆ operator=() [1/4]

template<typename U, typename T>
template<typename T1>
quantity & quantify::quantity< U, T >::operator= ( const quantity< U, T1 > & rhl)
inlineexport

Copy.

Definition at line 166 of file quantity.cppm.

+ Here is the call graph for this function:

◆ operator=() [2/4]

template<typename U, typename T>
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 & quantify::quantity< U, T >::operator= ( const quantity< U1, T1 > & rhl)
inlineexport

Copy.

Definition at line 178 of file quantity.cppm.

+ Here is the call graph for this function:

◆ operator=() [3/4]

template<typename U, typename T>
template<typename T1>
quantity & quantify::quantity< U, T >::operator= ( quantity< U, T1 > && rhl)
inlineexportnoexcept

Move.

Definition at line 202 of file quantity.cppm.

+ Here is the call graph for this function:

◆ operator=() [4/4]

template<typename U, typename T>
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 & quantify::quantity< U, T >::operator= ( quantity< U1, T1 > && rhl)
inlineexport

Move.

Definition at line 214 of file quantity.cppm.

+ Here is the call graph for this function:

◆ operator==() [1/2]

template<typename U, typename T>
template<typename U1>
requires SameScale<U, U1>
bool quantify::quantity< U, T >::operator== ( const quantity< U1, T > & rhl) const
inlineexport

Definition at line 54 of file quantity.cppm.

+ Here is the call graph for this function:

◆ operator==() [2/2]

template<typename U, typename T>
template<typename T1>
requires (not QuantityConcept<T1>)
bool quantify::quantity< U, T >::operator== ( const T1 & rhl) const
inlineexport

Definition at line 72 of file quantity.cppm.

◆ to_string()

template<typename U, typename T>
std::string quantify::quantity< U, T >::to_string ( ) const
inlinenodiscardexportnoexcept

Definition at line 253 of file quantity.cppm.

+ Here is the caller graph for this function:

◆ value_as_base_unit()

template<typename U, typename T>
T quantify::quantity< U, T >::value_as_base_unit ( ) const
inlineexport

Definition at line 36 of file quantity.cppm.


The documentation for this struct was generated from the following files: