| Name |
|---|
mp_units |
| Name | Description |
|---|---|
character_set | |
quantity_character | Quantity character |
unit_symbol_separator | |
unit_symbol_solidus |
| Name | Description |
|---|---|
abs | Computes the absolute value of a quantity |
castable | |
cbrt | cbrt overloads |
ceil | Computes the smallest quantity with integer representation and unit type To with its number not less than q |
contains | |
cubic | Computes the cubic power of a unit |
default_point_origin | |
dimension_symbol | |
dimension_symbol_to | |
epsilon | Returns the epsilon of the quantity |
exp | Computes Euler's raised to the given power |
explicitly_convertible | |
floor | Computes the largest quantity with integer representation and unit type To with its number not greater than q |
fma | fma overloads |
fmod | Computes the floating-point remainder of the division operation x / y. |
get | |
get_canonical_unit | |
get_common_quantity_spec | |
get_common_reference | |
get_common_unit | |
get_kind | |
get_quantity_spec | |
get_unit | |
hypot | hypot overloads |
implicitly_convertible | |
interconvertible | |
inverse | Computes the inverse of a quantity in a provided unit |
is_eq_zero | |
is_gt_zero | |
is_gteq_zero | |
is_lt_zero | |
is_lteq_zero | |
is_neq_zero | |
isfinite | isfinite overloads |
isinf | isinf overloads |
isnan | isnan overloads |
lerp | Linear interpolation or extrapolation |
magnitude | |
midpoint | Computes the midpoint of two points |
operator% | Modulus operators |
operator* | Multiplication operators |
operator+ | Addition operators |
operator- | Subtraction operators |
operator/ | Division operators |
pow | pow overloads |
quantity_cast | quantity_cast overloads |
remainder | Computes the IEEE remainder of the floating point division operation x / y. |
round | Computes the nearest quantity with integer representation and unit type To to q |
sqrt | sqrt overloads |
square | Computes the square power of a unit |
swap | |
unit_symbol | |
unit_symbol_to | |
unit_vector | |
value_cast | value_cast overloads |
operator<< | Stream insertion operators |
operator== | Equality operators |
operator<=> | Three-way comparison operators |
| Name | Description |
|---|---|
AssociatedUnit | A concept matching all units that can be used as quantity references |
Dimension | A concept matching all dimensions in the library. |
DimensionOf | A concept checking if the argument is of the same dimension. |
PointOrigin | A concept matching all quantity point origins in the library |
PointOriginFor | A concept matching all quantity point origins for a specified quantity type in the library |
PrefixableUnit | A concept to be used to define prefixes for a unit |
Quantity | A concept matching all quantities in the library |
QuantityLike | A concept matching all external quantities like types |
QuantityOf | A concept matching all quantities of the provided quantity spec |
QuantityPoint | A concept matching all quantity points in the library |
QuantityPointLike | A concept matching all external quantity point like types |
QuantityPointOf | A concept matching all quantity points of the provided property |
QuantitySpec | |
QuantitySpecOf | A concept matching all quantity specifications of a provided quantity spec value |
Reference | A concept matching all references in the library. |
ReferenceOf | A concept matching all references of the provided quantity spec |
RepresentationOf | |
Unit | A concept matching all unit types in the library |
UnitMagnitude | Concept to detect whether T is a valid UnitMagnitude. |
UnitOf | A concept matching all units associated with the provided quantity spec |
| Name | Description |
|---|---|
character_set | |
quantity_character | Quantity character |
unit_symbol_separator | |
unit_symbol_solidus |
| Name | Description |
|---|---|
abs | Computes the absolute value of a quantity |
castable | |
cbrt | cbrt overloads |
ceil | Computes the smallest quantity with integer representation and unit type To with its number not less than q |
contains | |
cubic | Computes the cubic power of a unit |
default_point_origin | |
dimension_symbol | |
dimension_symbol_to | |
epsilon | Returns the epsilon of the quantity |
exp | Computes Euler's raised to the given power |
explicitly_convertible | |
floor | Computes the largest quantity with integer representation and unit type To with its number not greater than q |
fma | fma overloads |
fmod | Computes the floating-point remainder of the division operation x / y. |
get | |
get_canonical_unit | |
get_common_quantity_spec | |
get_common_reference | |
get_common_unit | |
get_kind | |
get_quantity_spec | |
get_unit | |
hypot | hypot overloads |
implicitly_convertible | |
interconvertible | |
inverse | Computes the inverse of a quantity in a provided unit |
is_eq_zero | |
is_gt_zero | |
is_gteq_zero | |
is_lt_zero | |
is_lteq_zero | |
is_neq_zero | |
isfinite | isfinite overloads |
isinf | isinf overloads |
isnan | isnan overloads |
lerp | Linear interpolation or extrapolation |
magnitude | |
midpoint | Computes the midpoint of two points |
operator% | Modulus operators |
operator* | Multiplication operators |
operator+ | Addition operators |
operator- | Subtraction operators |
operator/ | Division operators |
pow | pow overloads |
quantity_cast | quantity_cast overloads |
remainder | Computes the IEEE remainder of the floating point division operation x / y. |
round | Computes the nearest quantity with integer representation and unit type To to q |
sqrt | sqrt overloads |
square | Computes the square power of a unit |
swap | |
unit_symbol | |
unit_symbol_to | |
unit_vector | |
value_cast | value_cast overloads |
operator<< | Stream insertion operators |
operator== | Equality operators |
operator<=> | Three-way comparison operators |
| Name | Description |
|---|---|
AssociatedUnit | A concept matching all units that can be used as quantity references |
Dimension | A concept matching all dimensions in the library. |
DimensionOf | A concept checking if the argument is of the same dimension. |
PointOrigin | A concept matching all quantity point origins in the library |
PointOriginFor | A concept matching all quantity point origins for a specified quantity type in the library |
PrefixableUnit | A concept to be used to define prefixes for a unit |
Quantity | A concept matching all quantities in the library |
QuantityLike | A concept matching all external quantities like types |
QuantityOf | A concept matching all quantities of the provided quantity spec |
QuantityPoint | A concept matching all quantity points in the library |
QuantityPointLike | A concept matching all external quantity point like types |
QuantityPointOf | A concept matching all quantity points of the provided property |
QuantitySpec | |
QuantitySpecOf | A concept matching all quantity specifications of a provided quantity spec value |
Reference | A concept matching all references in the library. |
ReferenceOf | A concept matching all references of the provided quantity spec |
RepresentationOf | |
Unit | A concept matching all unit types in the library |
UnitMagnitude | Concept to detect whether T is a valid UnitMagnitude. |
UnitOf | A concept matching all units associated with the provided quantity spec |
<mp-units/ext/type_traits.h>
template<
bool B,
typename T,
typename F>
using conditional = /* implementation-defined */::type<T, F>;
<mp-units/framework/symbolic_expression.h>
template<typename T>
using expr_type = /* implementation-defined */::type;
<mp-units/ext/fixed_string.h>
template<std::size_t N>
using fixed_string = basic_fixed_string<char, N>;
<mp-units/ext/fixed_string.h>
template<std::size_t N>
using fixed_u16string = basic_fixed_string<char16_t, N>;
<mp-units/ext/fixed_string.h>
template<std::size_t N>
using fixed_u32string = basic_fixed_string<char32_t, N>;
<mp-units/ext/fixed_string.h>
template<std::size_t N>
using fixed_u8string = basic_fixed_string<char8_t, N>;
<mp-units/ext/fixed_string.h>
template<std::size_t N>
using fixed_wstring = basic_fixed_string<wchar_t, N>;
<mp-units/ext/type_traits.h>
template<
class T,
class U>
using is_same = std::bool_constant<is_same_v<T, U>>;
<mp-units/framework/customization_points.h>
template<typename Rep>
using quantity_values = representation_values<Rep>;
<mp-units/ext/type_traits.h>
template<typename T>
requires std::is_object_v<T>
using value_type_t = /* implementation-defined */::type;
<mp-units/ext/type_traits.h>
template<typename T>
requires (!std::is_pointer_v<T> && !std::is_array_v<T>) &&
requires { typename std::indirectly_readable_traits<T>::value_type; }
using wrapped_type_t = std::indirectly_readable_traits<T>::value_type;
<mp-units/framework/quantity_point.h>
template<QuantitySpec auto QS>
struct absolute_point_origin
: /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ |
| Name |
|---|
_quantity_spec_ |
| Name | Description |
|---|---|
zeroth_point_origin_
|
<mp-units/framework/quantity_point.h>
inline constexpr static
QuantitySpec auto _quantity_spec_ = QS;
A dimension of a base quantity
<mp-units/framework/dimension.h>
template<symbol_text Symbol>
struct base_dimension
: /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ |
| Name | Description |
|---|---|
_symbol_ | Unique base dimension identifier |
Base quantity is a quantity in a conventionally chosen subset of a given system of quantities, where no quantity in the subset can be expressed in terms of the other quantities within that subset. They are referred to as being mutually independent since a base quantity cannot be expressed as a product of powers of the other base quantities.
Symbol template parameter is an unique identifier of the base dimension. The same identifiers can be multiplied and divided which will result with an adjustment of its factor in an exponent of a derived_dimension (in case of zero the dimension will be simplified and removed from further analysis of current expresion).
User should derive a strong type from this class template rather than use it directly in the source code. For example:
{.cpp}
inline constexpr struct dim_length final : base_dimension<"L"> {} dim_length;
inline constexpr struct dim_time final : base_dimension<"T"> {} dim_time;
inline constexpr struct dim_mass final : base_dimension<"M"> {} dim_mass;
A common convention in this library is to assign the same name for a type and an object of this type. Besides defining them user never works with the dimension types in the source code. All operations are done on the objects. Contrarily, the dimension types are the only one visible in the compilation errors. Having them of the same names improves user experience and somehow blurs those separate domains.
| Name | Description |
|---|---|
| Symbol | an unique identifier of the base dimension used to provide dimensional analysis support |
Unique base dimension identifier
<mp-units/framework/dimension.h>
inline constexpr static
auto _symbol_ = Symbol;
A compile-time fixed string
<mp-units/ext/fixed_string.h>
template<
typename CharT,
std::size_t N>
class basic_fixed_string;
| Name |
|---|
const_iterator |
const_pointer |
const_reference |
const_reverse_iterator |
difference_type |
iterator |
pointer |
reference |
reverse_iterator |
size_type |
value_type |
| Name | Description |
|---|---|
basic_fixed_string [constructor] | Constructors |
operator= | Copy assignment operator |
at | |
back | |
begin | |
c_str | |
cbegin | |
cend | |
crbegin | |
crend | |
data | |
end | |
front | |
operator[] | |
rbegin | |
rend | |
swap | |
view | |
operator std::basic_string_view<CharT> | Conversion to basic_string_view |
| Name |
|---|
data_ |
| Name |
|---|
empty |
length |
max_size |
size |
| Name | Description |
|---|---|
operator<< |
Stream insertion operator |
operator<=> |
Three-way comparison operator |
operator<=> |
Three-way comparison operator |
operator== |
Equality operator |
operator== |
Equality operator |
operator+ |
Addition operator |
operator+ |
Addition operator |
operator+ |
Addition operator |
operator+ |
Addition operator |
operator+ |
Addition operator |
| Name | Description |
|---|---|
| CharT | Character type to be used by the string |
| N | The size of the string |
<mp-units/ext/fixed_string.h>
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
<mp-units/ext/fixed_string.h>
using difference_type = std::ptrdiff_t;
<mp-units/ext/fixed_string.h>
using size_type = std::size_t;
<mp-units/ext/fixed_string.h>
using value_type = CharT;
Constructors
<mp-units/ext/fixed_string.h>Copy constructor
constexpr
basic_fixed_string(basic_fixed_string const& other) noexcept = default;
» more...
Construct from CharT
consteval
explicit(false)
basic_fixed_string(CharT const(& txt)[]) noexcept;
» more...
Construct from Chars
template<std::same_as<CharT>... Chars>
requires (sizeof...(Chars) == N) && (... && !std::is_pointer_v<Chars>)
constexpr
explicit
basic_fixed_string(Chars... chars) noexcept;
» more...
template<std::ranges::input_range R>
requires std::same_as<std::ranges::range_value_t<R>, CharT>
constexpr
basic_fixed_string(
std::from_range_t,
R&& r);
» more...
template<
std::input_iterator It,
std::sentinel_for<It> S>
requires std::same_as<std::iter_value_t<It>, CharT>
constexpr
basic_fixed_string(
It begin,
S end);
» more...
Copy constructor
<mp-units/ext/fixed_string.h>
constexpr
basic_fixed_string(basic_fixed_string const& other) noexcept = default;
| Name | Description |
|---|---|
| other | The object to copy construct from |
Construct from CharT
<mp-units/ext/fixed_string.h>
consteval
explicit(false)
basic_fixed_string(CharT const(& txt)[]) noexcept;
| Name | Description |
|---|---|
| txt | The object to copy construct from |
Construct from Chars
<mp-units/ext/fixed_string.h>
template<std::same_as<CharT>... Chars>
requires (sizeof...(Chars) == N) && (... && !std::is_pointer_v<Chars>)
constexpr
explicit
basic_fixed_string(Chars... chars) noexcept;
| Name | Description |
|---|---|
| chars | The object to construct from |
<mp-units/ext/fixed_string.h>
template<std::ranges::input_range R>
requires std::same_as<std::ranges::range_value_t<R>, CharT>
constexpr
basic_fixed_string(
std::from_range_t,
R&& r);
<mp-units/ext/fixed_string.h>
template<
std::input_iterator It,
std::sentinel_for<It> S>
requires std::same_as<std::iter_value_t<It>, CharT>
constexpr
basic_fixed_string(
It begin,
S end);
Copy assignment operator
<mp-units/ext/fixed_string.h>
constexpr
basic_fixed_string&
operator=(basic_fixed_string const& other) noexcept = default;
| Name | Description |
|---|---|
| other | The object to copy assign from |
<mp-units/ext/fixed_string.h>
[[nodiscard]]
constexpr
const_reference
at(size_type pos) const;
<mp-units/ext/fixed_string.h>
[[nodiscard]]
constexpr
const_reference
back() const;
<mp-units/ext/fixed_string.h>
[[nodiscard]]
constexpr
const_iterator
begin() const noexcept;
<mp-units/ext/fixed_string.h>
[[nodiscard]]
constexpr
const_pointer
c_str() const noexcept;
<mp-units/ext/fixed_string.h>
[[nodiscard]]
constexpr
const_iterator
cbegin() const noexcept;
<mp-units/ext/fixed_string.h>
[[nodiscard]]
constexpr
const_iterator
cend() const noexcept;
<mp-units/ext/fixed_string.h>
[[nodiscard]]
constexpr
const_reverse_iterator
crbegin() const noexcept;
<mp-units/ext/fixed_string.h>
[[nodiscard]]
constexpr
const_reverse_iterator
crend() const noexcept;
<mp-units/ext/fixed_string.h>
[[nodiscard]]
constexpr
const_pointer
data() const noexcept;
<mp-units/ext/fixed_string.h>
[[nodiscard]]
constexpr
const_iterator
end() const noexcept;
<mp-units/ext/fixed_string.h>
[[nodiscard]]
constexpr
const_reference
front() const;
<mp-units/ext/fixed_string.h>
[[nodiscard]]
constexpr
const_reference
operator[](size_type pos) const;
<mp-units/ext/fixed_string.h>
[[nodiscard]]
constexpr
const_reverse_iterator
rbegin() const noexcept;
<mp-units/ext/fixed_string.h>
[[nodiscard]]
constexpr
const_reverse_iterator
rend() const noexcept;
<mp-units/ext/fixed_string.h>
constexpr
void
swap(basic_fixed_string& s) noexcept;
<mp-units/ext/fixed_string.h>
[[nodiscard]]
constexpr
std::basic_string_view<CharT>
view() const noexcept;
Conversion to basic_string_view
<mp-units/ext/fixed_string.h>
[[nodiscard]]
constexpr
explicit(false)
operator std::basic_string_view<CharT>() const noexcept;
basic_string_view
<mp-units/ext/fixed_string.h>
CharT data_[] = {};
<mp-units/ext/fixed_string.h>
inline constexpr static
std::bool_constant<N == 0> empty = {};
<mp-units/ext/fixed_string.h>
inline constexpr static
std::integral_constant<size_type, N> length = {};
<mp-units/ext/fixed_string.h>
inline constexpr static
std::integral_constant<size_type, N> max_size = {};
<mp-units/ext/fixed_string.h>
inline constexpr static
std::integral_constant<size_type, N> size = {};
<mp-units/random.h>
struct binomial_distribution
: std::binomial_distribution<Q::rep>
| Name | Description |
|---|---|
std::binomial_distribution<Q::rep> |
| Name |
|---|
base |
rep |
| Name | Description |
|---|---|
binomial_distribution [constructor] | Constructors |
max | |
min | |
operator() | |
t |
<mp-units/random.h>
using base = std::binomial_distribution<rep>;
<mp-units/random.h>
using rep = Q::rep;
Constructors
<mp-units/random.h>Default constructor
binomial_distribution();
» more...
binomial_distribution(
Q const& t,
double p);
» more...
Default constructor
<mp-units/random.h>
binomial_distribution();
<mp-units/random.h>
binomial_distribution(
Q const& t,
double p);
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
[[nodiscard]]
Q
t() const;
<mp-units/random.h>
template<Quantity Q>
requires std::integral<typename Q::rep>
struct binomial_distribution
: std::binomial_distribution<Q::rep>
| Name | Description |
|---|---|
std::binomial_distribution<Q::rep> |
<mp-units/cartesian_vector.h>
template</* implementation-defined */ T = double>
class cartesian_vector
: public /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ |
| Name |
|---|
value_type |
| Name | Description |
|---|---|
cartesian_vector [constructor] | Constructors |
operator= | Assignment operators |
magnitude | |
operator*= | Multiplication assignment operator |
operator+ | Unary plus operator |
operator+= | Addition assignment operator |
operator- | Unary minus operator |
operator-= | Subtraction assignment operator |
operator/= | Division assignment operator |
operator[] | Subscript operators |
unit |
| Name |
|---|
_coordinates_ |
| Name | Description |
|---|---|
operator<< |
Stream insertion operator |
unit_vector |
|
magnitude |
<mp-units/cartesian_vector.h>
using value_type = T;
Constructors
<mp-units/cartesian_vector.h>Copy constructor
cartesian_vector(cartesian_vector const& other) = default;
» more...
Copy constructor
template<typename U>
requires std::constructible_from<T, U>
constexpr
explicit(!std::convertible_to<U, T>)
cartesian_vector(cartesian_vector<U> const& other);
» more...
Move constructor
cartesian_vector(cartesian_vector&& other) = default;
» more...
Move constructor
template<typename U>
requires std::constructible_from<T, U>
constexpr
explicit(!std::convertible_to<U, T>)
cartesian_vector(cartesian_vector<U>&& other);
» more...
Construct from Args
template<typename... Args>
requires (... && std::constructible_from<T, Args>)
constexpr
explicit(!(... && std::convertible_to<Args, T>))
cartesian_vector(Args...&&... args);
» more...
Copy constructor
<mp-units/cartesian_vector.h>
cartesian_vector(cartesian_vector const& other) = default;
| Name | Description |
|---|---|
| other | The object to copy construct from |
Copy constructor
<mp-units/cartesian_vector.h>
template<typename U>
requires std::constructible_from<T, U>
constexpr
explicit(!std::convertible_to<U, T>)
cartesian_vector(cartesian_vector<U> const& other);
| Name | Description |
|---|---|
| other | The object to copy construct from |
Move constructor
<mp-units/cartesian_vector.h>
cartesian_vector(cartesian_vector&& other) = default;
| Name | Description |
|---|---|
| other | The object to move construct from |
Move constructor
<mp-units/cartesian_vector.h>
template<typename U>
requires std::constructible_from<T, U>
constexpr
explicit(!std::convertible_to<U, T>)
cartesian_vector(cartesian_vector<U>&& other);
| Name | Description |
|---|---|
| other | The object to move construct from |
Construct from Args
<mp-units/cartesian_vector.h>
template<typename... Args>
requires (... && std::constructible_from<T, Args>)
constexpr
explicit(!(... && std::convertible_to<Args, T>))
cartesian_vector(Args...&&... args);
| Name | Description |
|---|---|
| args | The object to move construct from |
Assignment operators
<mp-units/cartesian_vector.h>Copy assignment operator
cartesian_vector&
operator=(cartesian_vector const& other) = default;
» more...
Copy assignment operator
template<std::convertible_to<T> U>
constexpr
cartesian_vector&
operator=(cartesian_vector<U> const& other);
» more...
Move assignment operator
cartesian_vector&
operator=(cartesian_vector&& other) = default;
» more...
Move assignment operator
template<std::convertible_to<T> U>
constexpr
cartesian_vector&
operator=(cartesian_vector<U>&& other);
» more...
Copy assignment operator
<mp-units/cartesian_vector.h>
cartesian_vector&
operator=(cartesian_vector const& other) = default;
| Name | Description |
|---|---|
| other | The object to copy assign from |
Copy assignment operator
<mp-units/cartesian_vector.h>
template<std::convertible_to<T> U>
constexpr
cartesian_vector&
operator=(cartesian_vector<U> const& other);
| Name | Description |
|---|---|
| other | The object to copy assign from |
Move assignment operator
<mp-units/cartesian_vector.h>
cartesian_vector&
operator=(cartesian_vector&& other) = default;
| Name | Description |
|---|---|
| other | The object to move assign from |
Move assignment operator
<mp-units/cartesian_vector.h>
template<std::convertible_to<T> U>
constexpr
cartesian_vector&
operator=(cartesian_vector<U>&& other);
| Name | Description |
|---|---|
| other | The object to move assign from |
<mp-units/cartesian_vector.h>
[[nodiscard]]
constexpr
T
magnitude() const
requires treat_as_floating_point<T>;
Multiplication assignment operator
<mp-units/cartesian_vector.h>
template<typename U>
requires requires(T t, U u) {
{ t *= u } -> std::same_as<T&>;
}
constexpr
cartesian_vector&
operator*=(U const& value);
| Name | Description |
|---|---|
| value | The right operand |
Unary plus operator
<mp-units/cartesian_vector.h>
[[nodiscard]]
constexpr
cartesian_vector
operator+() const;
Addition assignment operator
<mp-units/cartesian_vector.h>
template<typename U>
requires requires(T t, U u) {
{ t += u } -> std::same_as<T&>;
}
constexpr
cartesian_vector&
operator+=(cartesian_vector<U> const& other);
| Name | Description |
|---|---|
| other | The right operand |
Unary minus operator
<mp-units/cartesian_vector.h>
[[nodiscard]]
constexpr
cartesian_vector
operator-() const;
Subtraction assignment operator
<mp-units/cartesian_vector.h>
template<typename U>
requires requires(T t, U u) {
{ t -= u } -> std::same_as<T&>;
}
constexpr
cartesian_vector&
operator-=(cartesian_vector<U> const& other);
| Name | Description |
|---|---|
| other | The right operand |
Division assignment operator
<mp-units/cartesian_vector.h>
template<typename U>
requires requires(T t, U u) {
{ t /= u } -> std::same_as<T&>;
}
constexpr
cartesian_vector&
operator/=(U const& value);
| Name | Description |
|---|---|
| value | The right operand |
Subscript operators
<mp-units/cartesian_vector.h>
[[nodiscard]]
constexpr
T&
operator[](std::size_t i);
» more...
[[nodiscard]]
constexpr
T const&
operator[](std::size_t i) const;
» more...
<mp-units/cartesian_vector.h>
[[nodiscard]]
constexpr
T&
operator[](std::size_t i);
<mp-units/cartesian_vector.h>
[[nodiscard]]
constexpr
T const&
operator[](std::size_t i) const;
<mp-units/cartesian_vector.h>
[[nodiscard]]
constexpr
cartesian_vector
unit() const
requires treat_as_floating_point<T>;
<mp-units/cartesian_vector.h>
T _coordinates_[3];
<mp-units/random.h>
struct cauchy_distribution
: std::cauchy_distribution<Q::rep>
| Name | Description |
|---|---|
std::cauchy_distribution<Q::rep> |
| Name |
|---|
base |
rep |
| Name | Description |
|---|---|
cauchy_distribution [constructor] | Constructors |
a | |
b | |
max | |
min | |
operator() |
<mp-units/random.h>
using base = std::cauchy_distribution<rep>;
<mp-units/random.h>
using rep = Q::rep;
Constructors
<mp-units/random.h>Default constructor
cauchy_distribution();
» more...
cauchy_distribution(
Q const& a,
Q const& b);
» more...
Default constructor
<mp-units/random.h>
cauchy_distribution();
<mp-units/random.h>
cauchy_distribution(
Q const& a,
Q const& b);
<mp-units/random.h>
[[nodiscard]]
Q
a() const;
<mp-units/random.h>
[[nodiscard]]
Q
b() const;
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
template<Quantity Q>
requires std::floating_point<typename Q::rep>
struct cauchy_distribution
: std::cauchy_distribution<Q::rep>
| Name | Description |
|---|---|
std::cauchy_distribution<Q::rep> |
<mp-units/random.h>
struct chi_squared_distribution
: std::chi_squared_distribution<Q::rep>
| Name | Description |
|---|---|
std::chi_squared_distribution<Q::rep> |
| Name |
|---|
base |
rep |
| Name | Description |
|---|---|
chi_squared_distribution [constructor] | Constructors |
max | |
min | |
operator() |
<mp-units/random.h>
using base = std::chi_squared_distribution<rep>;
<mp-units/random.h>
using rep = Q::rep;
Constructors
<mp-units/random.h>Default constructor
chi_squared_distribution();
» more...
Construct from rep
explicit
chi_squared_distribution(rep const& n);
» more...
Default constructor
<mp-units/random.h>
chi_squared_distribution();
Construct from rep
| Name | Description |
|---|---|
| n | The object to copy construct from |
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
template<Quantity Q>
requires std::floating_point<typename Q::rep>
struct chi_squared_distribution
: std::chi_squared_distribution<Q::rep>
| Name | Description |
|---|---|
std::chi_squared_distribution<Q::rep> |
Measurement unit for an accumulation of two quantities of different units
<mp-units/framework/unit.h>
template<
Unit U1,
Unit U2,
Unit... Rest>
struct common_unit final
: ::_base_type_
| Name | Description |
|---|---|
::_base_type_ |
| Name |
|---|
_base_type_ |
| Name |
|---|
_common_unit_ |
While adding two quantities of different units we can often identify which of those unit should be used to prevent data truncation. For example, adding 1 * m + 1 * mm will end up in a quantity expressed in millimeters. However, for some cases this is not possible. Choosing any of the units from the arguments of the addition would result in a data truncation. For example, a common unit for 1 * km + 1 * mi is [8/125] m. Instead of returning such a complex unit type the library will return a common_unit<mi, km>. This type is convertible to both mi and km without risking data truncation, but is not equal to any of them.
User should not instantiate this type! It is not exported from the C++ module. The library will instantiate this type automatically based on the unit arithmetic equation provided by the user.
<mp-units/framework/unit.h>
inline constexpr static
auto _common_unit_ = detail::get_common_scaled_unit(U1{}, U2{}, Rest{}...);
<mp-units/framework/construction_helpers.h>
template<Reference R>
struct delta_;
| Name | Description |
|---|---|
operator() | Function call operator |
Function call operator
<mp-units/framework/construction_helpers.h>
template<
typename FwdRep,
RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>>
[[nodiscard]]
constexpr
quantity<R{}, Rep>
operator()(FwdRep&& lhs) const;
| Name | Description |
|---|---|
| lhs | The right operand |
A dimension of a derived quantity
<mp-units/framework/dimension.h>
template</* implementation-defined */... Expr>
struct derived_dimension final
: /* implementation-defined */
, /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ | |
/* implementation-defined */ |
Derived dimension is an expression of the dependence of a quantity on the base quantities of a system of quantities as a product of powers of factors corresponding to the base quantities, omitting any numerical factors.
Instead of using a raw list of exponents this library decided to use symbolic expression syntax to make types more digestable for the user. The positive exponents are ordered first and all negative exponents are put as a list into the per<...> class template. If a power of exponent is different than 1 the dimension type is enclosed in power<Dim, Num, Den> class template. Otherwise, it is just put directly in the list without any wrapper. There is also one special case. In case all of the exponents are negative than the dimension_one being a dimension of a dimensionless quantity is put in the front to increase the readability.
For example:
{.cpp}
using frequency = decltype(inverse(dim_time));
using speed = decltype(dim_length / dim_time);
using acceleration = decltype(dim_speed / dim_time);
using force = decltype(dim_mass * dim_acceleration);
using energy = decltype(dim_force * dim_length);
using moment_of_force = decltype(dim_length * dim_force);
using torque = decltype(dim_moment_of_force);
- frequency will be derived from type derived_dimension<dimension_one, per<dim_time>> - speed will be derived from type derived_dimension<dim_length, per<dim_time>> - acceleration will be derived from type derived_dimension<dim_length, per<power<dim_time, 2>>> - force will be derived from type derived_dimension<dim_length, dim_mass, per<power<dim_time, 2>>> - energy will be derived from type derived_dimension<power<dim_length, 2>, dim_mass, per<power<dim_time, 2>>>
A common convention in this library is to assign the same name for a type and an object of this type. Besides defining them user never works with the dimension types in the source code. All operations are done on the objects. Contrarily, the dimension types are the only one visible in the compilation errors. Having them of the same names improves user experience and somehow blurs those separate domains.
User should not instantiate this type! It is not exported from the C++ module. The library will instantiate this type automatically based on the dimensional arithmetic equation provided by the user.
| Name | Description |
|---|---|
| Ds | a parameter pack consisting tokens allowed in the dimension specification (base dimensions, dimension_one, power<Dim, Num, Den>, per<...>) |
A specification of a derived quantity
<mp-units/framework/quantity_spec.h>
template</* implementation-defined */... Expr>
struct derived_quantity_spec final
: /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ |
Derived quantity is a quantity, in a system of quantities, defined in terms of other quantities of that system. Its dimension is an expression of the dependence of a quantity on the base quantities of a system of quantities as a product of powers of factors corresponding to the base quantities, omitting any numerical factors.
Instead of using a raw list of exponents this library decided to use symbolic expression syntax to make types more digestable for the user both for quantity specification and its dimension. The positive exponents are ordered first and all negative exponents are put as a list into the per<...> class template. If a power of exponent is different than 1 the quantity type is enclosed in power<Q, Num, Den> class template. Otherwise, it is just put directly in the list without any wrapper. In case all of the exponents are negative than the dimensionless/dimension_one is put in the front to increase the readability.
The character of those quantities is derived from ingredients or overriden with a template parameter.
For example:
{.cpp}
auto frequency = inverse(period_duration);
auto area = pow<2>(length);
auto speed = distance / duration;
auto velocity = displacement / duration;
auto acceleration = velocity / duration;
- the type of frequency is derived_quantity_spec<dimensionless, per<period_duration>> - the dimension type of frequency is derived_dimension<dimension_one, per<dim_time>> - the type of area is derived_quantity_spec<power<length, 2>> - the dimension type of area is derived_dimension<power<dim_length, 2>> - the type of speed is derived_quantity_spec<distance, per<duration>> - the dimension type of speed is derived_dimension<dim_length, per<dim_time>> - the type of velocity is derived_quantity_spec<displacement, per<duration>> - the dimension type of velocity is derived_dimension<dim_length, per<dim_time>> - the type of acceleration is derived_quantity_spec<velocity, per<duration>> - the dimension type of acceleration is derived_dimension<dim_length, per<power<dim_time, 2>>>
User should not instantiate this type! It is not exported from the C++ module. The library will instantiate this type automatically based on the dimensional arithmetic equation provided by the user.
| Name | Description |
|---|---|
| Expr | a parameter pack consisting tokens allowed in the quantity specification (named quantity specification, dimensionless, power<Q, Num, Den>, per<...>) |
Measurement unit for a derived quantity
<mp-units/framework/unit.h>
template</* implementation-defined */... Expr>
struct derived_unit final
: /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ |
Derived units are defined as products of powers of the base units.
Instead of using a raw list of exponents this library decided to use expression template syntax to make types more digestable for the user. The positive exponents are ordered first and all negative exponents are put as a list into the per<...> class template. If a power of exponent is different than 1 the unit type is enclosed in power<Dim, Num, Den> class template. Otherwise, it is just put directly in the list without any wrapper. There is also one special case. In case all of the exponents are negative then the one being a coherent unit of a dimensionless quantity is put in the front to increase the readability.
For example:
{.cpp}
static_assert(is_of_type<inverse(second), derived_unit<one, per<second>>>);
static_assert(is_of_type<one / inverse(second), second>);
static_assert(is_of_type<one * second, second>);
static_assert(is_of_type<metre * metre, derived_unit<power<metre, 2>>>);
static_assert(is_of_type<metre * second, derived_unit<metre, second>>);
static_assert(is_of_type<metre / second, derived_unit<metre, per<second>>>);
static_assert(is_of_type<metre / square(second), derived_unit<metre, per<power<second, 2>>>>);
static_assert(is_of_type<watt / joule, derived_unit<watt, per<joule>>>);
Every unit in the library has its internal canonical representation being the list of exponents of named base units (with the exception of kilogram which is represented as gram here) and a scaling ratio represented with a magnitude.
Two units are deemed convertible if their canonical version has units of the same type. Two units are equivalent when they are convertible and their canonical versions have the same scaling ratios.
The above means that: - 1/s and Hz are both convertible and equal - m and km are convertible but not equal - m and m² ane not convertible and not equal
This also means that units like hertz and becquerel are also considered convertible and equal.
User should not instantiate this type! It is not exported from the C++ module. The library will instantiate this type automatically based on the unit arithmetic equation provided by the user.
| Name | Description |
|---|---|
| Us | a parameter pack consisting tokens allowed in the unit specification (units, power<U, Num, Den>, per<...>) |
Dimension one
<mp-units/framework/dimension.h>
struct dimension_one final
: /* implementation-defined */
, /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ | |
/* implementation-defined */ |
Dimension for which all the exponents of the factors corresponding to the base dimensions are zero. It is a dimension of a quantity of dimension one also known as "dimensionless".
<mp-units/framework/dimension.h>
struct dimension_symbol_formatting;
| Name |
|---|
char_set |
<mp-units/framework/dimension.h>
character_set char_set = character_set::default_character_set;
Quantity of dimension one
<mp-units/framework/quantity_spec.h>
struct dimensionless final
: mp_units::quantity_spec<derived_quantity_spec<>{}>
| Name | Description |
|---|---|
mp_units::quantity_spec<derived_quantity_spec<>{}> |
Quantity of dimension one also commonly named as "dimensionless" is a quantity with a dimension for which all the exponents of the factors corresponding to the base dimensions are zero.
<mp-units/random.h>
struct discrete_distribution
: std::discrete_distribution<Q::rep>
| Name | Description |
|---|---|
std::discrete_distribution<Q::rep> |
| Name |
|---|
base |
rep |
| Name | Description |
|---|---|
discrete_distribution [constructor] | Constructors |
max | |
min | |
operator() |
<mp-units/random.h>
using base = std::discrete_distribution<rep>;
<mp-units/random.h>
using rep = Q::rep;
Constructors
<mp-units/random.h>Default constructor
discrete_distribution();
» more...
Construct from initializer_list
discrete_distribution(std::initializer_list<double> weights);
» more...
template<typename InputIt>
discrete_distribution(
InputIt first,
InputIt last);
» more...
template<typename UnaryOperation>
discrete_distribution(
std::size_t count,
double xmin,
double xmax,
UnaryOperation unary_op);
» more...
Default constructor
<mp-units/random.h>
discrete_distribution();
Construct from initializer_list
<mp-units/random.h>
discrete_distribution(std::initializer_list<double> weights);
| Name | Description |
|---|---|
| weights | The object to construct from |
<mp-units/random.h>
template<typename InputIt>
discrete_distribution(
InputIt first,
InputIt last);
<mp-units/random.h>
template<typename UnaryOperation>
discrete_distribution(
std::size_t count,
double xmin,
double xmax,
UnaryOperation unary_op);
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
template<Quantity Q>
requires std::integral<typename Q::rep>
struct discrete_distribution
: std::discrete_distribution<Q::rep>
| Name | Description |
|---|---|
std::discrete_distribution<Q::rep> |
<mp-units/random.h>
struct exponential_distribution
: std::exponential_distribution<Q::rep>
| Name | Description |
|---|---|
std::exponential_distribution<Q::rep> |
| Name |
|---|
base |
rep |
| Name | Description |
|---|---|
exponential_distribution [constructor] | Constructors |
max | |
min | |
operator() |
<mp-units/random.h>
using base = std::exponential_distribution<rep>;
<mp-units/random.h>
using rep = Q::rep;
Constructors
<mp-units/random.h>Default constructor
exponential_distribution();
» more...
Construct from rep
explicit
exponential_distribution(rep const& lambda);
» more...
Default constructor
<mp-units/random.h>
exponential_distribution();
Construct from rep
| Name | Description |
|---|---|
| lambda | The object to copy construct from |
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
template<Quantity Q>
requires std::floating_point<typename Q::rep>
struct exponential_distribution
: std::exponential_distribution<Q::rep>
| Name | Description |
|---|---|
std::exponential_distribution<Q::rep> |
<mp-units/random.h>
struct extreme_value_distribution
: std::extreme_value_distribution<Q::rep>
| Name | Description |
|---|---|
std::extreme_value_distribution<Q::rep> |
| Name |
|---|
base |
rep |
| Name | Description |
|---|---|
extreme_value_distribution [constructor] | Constructors |
a | |
max | |
min | |
operator() |
<mp-units/random.h>
using base = std::extreme_value_distribution<rep>;
<mp-units/random.h>
using rep = Q::rep;
Constructors
<mp-units/random.h>Default constructor
extreme_value_distribution();
» more...
extreme_value_distribution(
Q const& a,
rep const& b);
» more...
Default constructor
<mp-units/random.h>
extreme_value_distribution();
<mp-units/random.h>
[[nodiscard]]
Q
a() const;
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
template<Quantity Q>
requires std::floating_point<typename Q::rep>
struct extreme_value_distribution
: std::extreme_value_distribution<Q::rep>
| Name | Description |
|---|---|
std::extreme_value_distribution<Q::rep> |
<mp-units/random.h>
struct fisher_f_distribution
: std::fisher_f_distribution<Q::rep>
| Name | Description |
|---|---|
std::fisher_f_distribution<Q::rep> |
| Name |
|---|
base |
rep |
| Name | Description |
|---|---|
fisher_f_distribution [constructor] | Constructors |
max | |
min | |
operator() |
<mp-units/random.h>
using base = std::fisher_f_distribution<rep>;
<mp-units/random.h>
using rep = Q::rep;
Constructors
<mp-units/random.h>Default constructor
fisher_f_distribution();
» more...
fisher_f_distribution(
rep const& m,
rep const& n);
» more...
Default constructor
<mp-units/random.h>
fisher_f_distribution();
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
template<Quantity Q>
requires std::floating_point<typename Q::rep>
struct fisher_f_distribution
: std::fisher_f_distribution<Q::rep>
| Name | Description |
|---|---|
std::fisher_f_distribution<Q::rep> |
<mp-units/random.h>
struct gamma_distribution
: std::gamma_distribution<Q::rep>
| Name | Description |
|---|---|
std::gamma_distribution<Q::rep> |
| Name |
|---|
base |
rep |
| Name | Description |
|---|---|
gamma_distribution [constructor] | Constructors |
max | |
min | |
operator() |
<mp-units/random.h>
using base = std::gamma_distribution<rep>;
<mp-units/random.h>
using rep = Q::rep;
Constructors
<mp-units/random.h>Default constructor
gamma_distribution();
» more...
gamma_distribution(
rep const& alpha,
rep const& beta);
» more...
Default constructor
<mp-units/random.h>
gamma_distribution();
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
template<Quantity Q>
requires std::floating_point<typename Q::rep>
struct gamma_distribution
: std::gamma_distribution<Q::rep>
| Name | Description |
|---|---|
std::gamma_distribution<Q::rep> |
<mp-units/random.h>
struct geometric_distribution
: std::geometric_distribution<Q::rep>
| Name | Description |
|---|---|
std::geometric_distribution<Q::rep> |
| Name |
|---|
base |
rep |
| Name | Description |
|---|---|
geometric_distribution [constructor] | Constructors |
max | |
min | |
operator() |
<mp-units/random.h>
using base = std::geometric_distribution<rep>;
<mp-units/random.h>
using rep = Q::rep;
Constructors
<mp-units/random.h>Default constructor
geometric_distribution();
» more...
Construct from double
explicit
geometric_distribution(double p);
» more...
Default constructor
<mp-units/random.h>
geometric_distribution();
Construct from double
<mp-units/random.h>
explicit
geometric_distribution(double p);
| Name | Description |
|---|---|
| p | The value to construct from |
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
template<Quantity Q>
requires std::integral<typename Q::rep>
struct geometric_distribution
: std::geometric_distribution<Q::rep>
| Name | Description |
|---|---|
std::geometric_distribution<Q::rep> |
<mp-units/framework/quantity_spec.h>
struct is_kind;
<mp-units/framework/quantity_spec_concepts.h>
template<typename Q>
struct kind_of_;
<mp-units/framework/quantity_spec.h>
template<QuantitySpec Q>
requires (!detail::QuantityKindSpec<Q>) && (detail::get_kind_tree_root(Q{}) == Q{})
struct kind_of_<Q> final
: Q::_base_type_
| Name | Description |
|---|---|
Q::_base_type_ |
| Name |
|---|
_base_type_ |
| Name |
|---|
_quantity_spec_ |
<mp-units/framework/quantity_spec.h>
inline constexpr static
auto _quantity_spec_ = Q{};
<mp-units/random.h>
struct lognormal_distribution
: std::lognormal_distribution<Q::rep>
| Name | Description |
|---|---|
std::lognormal_distribution<Q::rep> |
| Name |
|---|
base |
rep |
| Name | Description |
|---|---|
lognormal_distribution [constructor] | Constructors |
m | |
max | |
min | |
operator() | |
s |
<mp-units/random.h>
using base = std::lognormal_distribution<rep>;
<mp-units/random.h>
using rep = Q::rep;
Constructors
<mp-units/random.h>Default constructor
lognormal_distribution();
» more...
lognormal_distribution(
Q const& m,
Q const& s);
» more...
Default constructor
<mp-units/random.h>
lognormal_distribution();
<mp-units/random.h>
lognormal_distribution(
Q const& m,
Q const& s);
<mp-units/random.h>
[[nodiscard]]
Q
m() const;
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
[[nodiscard]]
Q
s() const;
<mp-units/random.h>
template<Quantity Q>
requires std::floating_point<typename Q::rep>
struct lognormal_distribution
: std::lognormal_distribution<Q::rep>
| Name | Description |
|---|---|
std::lognormal_distribution<Q::rep> |
<mp-units/framework/unit_magnitude.h>
template<
symbol_text Symbol,
long double Value>
requires (Value > 0)
struct mag_constant;
| Name |
|---|
_symbol_ |
_value_ |
| Name | Description |
|---|---|
pi
|
<mp-units/framework/unit_magnitude.h>
inline constexpr static
auto _symbol_ = Symbol;
<mp-units/framework/unit_magnitude.h>
inline constexpr static
long double _value_ = Value;
A named unit
<mp-units/framework/unit.h>
template<
symbol_text Symbol,
auto...>
struct named_unit;
| Name | Description |
|---|---|
parts_per_million
| |
per_mille
| |
percent
|
Defines a unit with a special name. It may be used to provide a base unit in the system of units (e.g. metre) or a name assigned to another scaled or derived unit (e.g. hour, joule). Most of the named units may be composed with a prefix to create a prefixed_unit.
For example:
{.cpp}
inline constexpr struct second final : named_unit<"s", kind_of<time>> {} second;
inline constexpr struct metre final : named_unit<"m", kind_of<length> {} metre;
inline constexpr struct hertz final : named_unit<"Hz", inverse(second), kind_of<frequency>> {} hertz;
inline constexpr struct newton final : named_unit<"N", kilogram * metre / square(second)> {} newton;
inline constexpr struct degree_Celsius final : named_unit<{u8"℃", "`C"}, kelvin, zeroth_degree_Celsius> {}
degree_Celsius; inline constexpr struct minute final : named_unit<"min", mag<60> * second> {} minute;
A common convention in this library is to assign the same name for a type and an object of this type. Besides defining them user never works with the unit types in the source code. All operations are done on the objects. Contrarily, the unit types are the only one visible in the compilation errors. Having them of the same names improves user experience and somehow blurs those separate domains.
| Name | Description |
|---|---|
| Symbol | a short text representation of the unit |
Specialization for a unit that can be reused by several base quantities
<mp-units/framework/unit.h>
template<symbol_text Symbol>
requires (!Symbol.empty())
struct named_unit<Symbol>
: /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ |
| Name |
|---|
_base_type_ |
| Name | Description |
|---|---|
_symbol_ | Unique base unit identifier |
This specialization is used in rare cases where more than one base quantity in a specific system of units uses the same unit. For example in a hypothetical system of natural units where constant for speed of light c = 1, length and time could be measured in seconds. In such cases system_reference has to be used to explicitly express such a binding.
| Name | Description |
|---|---|
| Symbol | a short text representation of the unit |
Unique base unit identifier
<mp-units/framework/unit.h>
inline constexpr static
auto _symbol_ = Symbol;
Specialization for unit of a specified base quantity
<mp-units/framework/unit.h>
template<
symbol_text Symbol,
Unit auto QS>
requires (!Symbol.empty())
struct named_unit<Symbol, U>
: /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ |
| Name |
|---|
_base_type_ |
| Name | Description |
|---|---|
_quantity_spec_ | |
_symbol_ | Unique base unit identifier |
Associates a unit with a specified base quantity. For example si::metre is a unit to measure isq::length in the SI system.
This is the preferred way to define a measurement unit for a specific base quantity.
It does not have to (or sometimes even can't) be a proper system's base unit. For example a base unit of mass in the SI is si::kilogram but here you are about to provide an si::gram and it will work just fine as those two are convertible to each other. A similar case would be the cgs::centimetre that is a base unit for isq::length in the CGS system.
Allows assigning a special name to another scaled or derived unit (e.g. hour, joule).
| Name | Description |
|---|---|
| Symbol | a short text representation of the unit |
| QuantitySpec | a specification of a base quantity to be measured with this unit |
| Unit | a unit for which we provide a special name |
<mp-units/framework/unit.h>
inline constexpr static
auto _quantity_spec_ = QS;
Unique base unit identifier
<mp-units/framework/unit.h>
inline constexpr static
auto _symbol_ = Symbol;
Unique unit identifier
Specialization for a unit with special name valid only for a specific quantity
<mp-units/framework/unit.h>
template<
symbol_text Symbol,
AssociatedUnit auto QS,
/* implementation-defined */ auto PO>
requires (!Symbol.empty()) && (QS.dimension == detail::get_associated_quantity(U).dimension)
struct named_unit<Symbol, U, QS>
: /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ |
| Name |
|---|
_base_type_ |
| Name | Description |
|---|---|
_point_origin_ | |
_quantity_spec_ | |
_symbol_ | Unique base unit identifier |
The same as the above but additionally limits the usage of this unit to provided quantities.
| Name | Description |
|---|---|
| Symbol | a short text representation of the unit |
| Unit | a unit for which we provide a special name |
| QuantitySpec | a specification of a quantity to be measured with this unit |
<mp-units/framework/unit.h>
inline constexpr static
auto _point_origin_ = PO;
<mp-units/framework/unit.h>
inline constexpr static
auto _quantity_spec_ = QS;
Unique base unit identifier
<mp-units/framework/unit.h>
inline constexpr static
auto _symbol_ = Symbol;
Unique unit identifier
Unique unit identifier
<mp-units/framework/unit.h>
template<
symbol_text Symbol,
AssociatedUnit auto U,
/* implementation-defined */ auto QS,
PointOrigin auto PO>
requires (!Symbol.empty()) && (QS.dimension == detail::get_associated_quantity(U).dimension)
struct named_unit<Symbol, U, QS, PO>
: ::_base_type_
| Name | Description |
|---|---|
::_base_type_ |
| Name |
|---|
_base_type_ |
| Name | Description |
|---|---|
_point_origin_ | |
_quantity_spec_ | |
_symbol_ | Unique unit identifier |
<mp-units/framework/unit.h>
inline constexpr static
auto _point_origin_ = PO;
<mp-units/framework/unit.h>
inline constexpr static
auto _quantity_spec_ = QS;
Unique unit identifier
<mp-units/framework/unit.h>
inline constexpr static
auto _symbol_ = Symbol;
<mp-units/random.h>
struct negative_binomial_distribution
: std::negative_binomial_distribution<Q::rep>
| Name | Description |
|---|---|
std::negative_binomial_distribution<Q::rep> |
| Name |
|---|
base |
rep |
| Name | Description |
|---|---|
negative_binomial_distribution [constructor] | Constructors |
k | |
max | |
min | |
operator() |
<mp-units/random.h>
using base = std::negative_binomial_distribution<rep>;
<mp-units/random.h>
using rep = Q::rep;
Constructors
<mp-units/random.h>Default constructor
negative_binomial_distribution();
» more...
negative_binomial_distribution(
Q const& k,
double p);
» more...
Default constructor
<mp-units/random.h>
negative_binomial_distribution();
<mp-units/random.h>
negative_binomial_distribution(
Q const& k,
double p);
<mp-units/random.h>
[[nodiscard]]
Q
k() const;
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
template<Quantity Q>
requires std::integral<typename Q::rep>
struct negative_binomial_distribution
: std::negative_binomial_distribution<Q::rep>
| Name | Description |
|---|---|
std::negative_binomial_distribution<Q::rep> |
<mp-units/random.h>
struct normal_distribution
: std::normal_distribution<Q::rep>
| Name | Description |
|---|---|
std::normal_distribution<Q::rep> |
| Name |
|---|
base |
rep |
| Name | Description |
|---|---|
normal_distribution [constructor] | Constructors |
max | |
mean | |
min | |
operator() | |
stddev |
<mp-units/random.h>
using base = std::normal_distribution<rep>;
<mp-units/random.h>
using rep = Q::rep;
Constructors
<mp-units/random.h>Default constructor
normal_distribution();
» more...
normal_distribution(
Q const& mean,
Q const& stddev);
» more...
Default constructor
<mp-units/random.h>
normal_distribution();
<mp-units/random.h>
normal_distribution(
Q const& mean,
Q const& stddev);
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
mean() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
[[nodiscard]]
Q
stddev() const;
<mp-units/random.h>
template<Quantity Q>
requires std::floating_point<typename Q::rep>
struct normal_distribution
: std::normal_distribution<Q::rep>
| Name | Description |
|---|---|
std::normal_distribution<Q::rep> |
Unit one
<mp-units/framework/unit.h>
struct one final
: /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ |
| Name |
|---|
_base_type_ |
Unit of a dimensionless quantity.
<mp-units/framework/unit.h>
using _base_type_ = /* implementation-defined */;
<mp-units/framework/unit.h>
struct parts_per_million final
: named_unit<"ppm", mag_ratio<1, 1000000> * one>
| Name | Description |
|---|---|
named_unit<"ppm", mag_ratio<1, 1000000> * one> | A named unit |
Type list type storing the list of components with negative exponents
<mp-units/framework/symbolic_expression.h>
template<
/* implementation-defined */ T,
/* implementation-defined */... Ts>
struct per final
Can't be empty
<mp-units/framework/unit.h>
struct per_mille final
: named_unit<symbol_text<4UL - 1, 3UL - 1>{u8"\342\200\260", "%o"}, mag_ratio<1, 1000> * one>
| Name | Description |
|---|---|
named_unit<symbol_text<4UL - 1, 3UL - 1>{u8"\342\200\260", "%o"}, mag_ratio<1, 1000> * one> | A named unit |
<mp-units/framework/unit.h>
struct percent final
: named_unit<"%", mag_ratio<1, 100> * one>
| Name | Description |
|---|---|
named_unit<"%", mag_ratio<1, 100> * one> | A named unit |
<mp-units/framework/unit_magnitude.h>
struct pi final
: mag_constant<symbol_text<3UL - 1, 3UL - 1>{u8"\317\200", "pi"}, std::numbers::pi_v<long double>>
| Name | Description |
|---|---|
mag_constant<symbol_text<3UL - 1, 3UL - 1>{u8"\317\200", "pi"}, std::numbers::pi_v<long double>> |
<mp-units/random.h>
class piecewise_constant_distribution
: public std::piecewise_constant_distribution<Q::rep>
| Name | Description |
|---|---|
std::piecewise_constant_distribution<Q::rep> |
| Name | Description |
|---|---|
piecewise_constant_distribution [constructor] | Constructors |
intervals | |
max | |
min | |
operator() |
Constructors
<mp-units/random.h>Default constructor
piecewise_constant_distribution();
» more...
template<typename UnaryOperation>
piecewise_constant_distribution(
std::initializer_list<Q> bl,
UnaryOperation fw);
» more...
template<
typename InputIt1,
typename InputIt2>
piecewise_constant_distribution(
InputIt1 first_i,
InputIt1 last_i,
InputIt2 first_w);
» more...
template<typename UnaryOperation>
piecewise_constant_distribution(
std::size_t nw,
Q const& xmin,
Q const& xmax,
UnaryOperation fw);
» more...
Default constructor
<mp-units/random.h>
piecewise_constant_distribution();
<mp-units/random.h>
template<typename UnaryOperation>
piecewise_constant_distribution(
std::initializer_list<Q> bl,
UnaryOperation fw);
<mp-units/random.h>
template<
typename InputIt1,
typename InputIt2>
piecewise_constant_distribution(
InputIt1 first_i,
InputIt1 last_i,
InputIt2 first_w);
<mp-units/random.h>
template<typename UnaryOperation>
piecewise_constant_distribution(
std::size_t nw,
Q const& xmin,
Q const& xmax,
UnaryOperation fw);
<mp-units/random.h>
[[nodiscard]]
std::vector<Q>
intervals() const;
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
template<Quantity Q>
requires std::floating_point<typename Q::rep>
class piecewise_constant_distribution
: public std::piecewise_constant_distribution<Q::rep>
| Name | Description |
|---|---|
std::piecewise_constant_distribution<Q::rep> |
<mp-units/random.h>
class piecewise_linear_distribution
: public std::piecewise_linear_distribution<Q::rep>
| Name | Description |
|---|---|
std::piecewise_linear_distribution<Q::rep> |
| Name | Description |
|---|---|
piecewise_linear_distribution [constructor] | Constructors |
intervals | |
max | |
min | |
operator() |
Constructors
<mp-units/random.h>Default constructor
piecewise_linear_distribution();
» more...
template<typename UnaryOperation>
piecewise_linear_distribution(
std::initializer_list<Q> bl,
UnaryOperation fw);
» more...
template<
typename InputIt1,
typename InputIt2>
piecewise_linear_distribution(
InputIt1 first_i,
InputIt1 last_i,
InputIt2 first_w);
» more...
template<typename UnaryOperation>
piecewise_linear_distribution(
std::size_t nw,
Q const& xmin,
Q const& xmax,
UnaryOperation fw);
» more...
Default constructor
<mp-units/random.h>
piecewise_linear_distribution();
<mp-units/random.h>
template<typename UnaryOperation>
piecewise_linear_distribution(
std::initializer_list<Q> bl,
UnaryOperation fw);
<mp-units/random.h>
template<
typename InputIt1,
typename InputIt2>
piecewise_linear_distribution(
InputIt1 first_i,
InputIt1 last_i,
InputIt2 first_w);
<mp-units/random.h>
template<typename UnaryOperation>
piecewise_linear_distribution(
std::size_t nw,
Q const& xmin,
Q const& xmax,
UnaryOperation fw);
<mp-units/random.h>
[[nodiscard]]
std::vector<Q>
intervals() const;
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
template<Quantity Q>
requires std::floating_point<typename Q::rep>
class piecewise_linear_distribution
: public std::piecewise_linear_distribution<Q::rep>
| Name | Description |
|---|---|
std::piecewise_linear_distribution<Q::rep> |
<mp-units/framework/construction_helpers.h>
template<Reference R>
struct point_;
| Name | Description |
|---|---|
operator() | Function call operator |
Function call operator
<mp-units/framework/construction_helpers.h>
template<
typename FwdRep,
RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>>
[[nodiscard]]
constexpr
quantity_point<R{}, default_point_origin(R{}), Rep>
operator()(FwdRep&& lhs) const;
| Name | Description |
|---|---|
| lhs | The right operand |
<mp-units/random.h>
struct poisson_distribution
: std::poisson_distribution<Q::rep>
| Name | Description |
|---|---|
std::poisson_distribution<Q::rep> |
| Name |
|---|
base |
rep |
| Name | Description |
|---|---|
poisson_distribution [constructor] | Constructors |
max | |
min | |
operator() |
<mp-units/random.h>
using base = std::poisson_distribution<rep>;
<mp-units/random.h>
using rep = Q::rep;
Constructors
<mp-units/random.h>Default constructor
poisson_distribution();
» more...
Construct from double
explicit
poisson_distribution(double p);
» more...
Default constructor
<mp-units/random.h>
poisson_distribution();
Construct from double
<mp-units/random.h>
explicit
poisson_distribution(double p);
| Name | Description |
|---|---|
| p | The value to construct from |
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
template<Quantity Q>
requires std::integral<typename Q::rep>
struct poisson_distribution
: std::poisson_distribution<Q::rep>
| Name | Description |
|---|---|
std::poisson_distribution<Q::rep> |
Type container for exponents with ratio different than 1
<mp-units/framework/symbolic_expression.h>
template<
/* implementation-defined */ F,
int Num,
int Den...>
requires (detail::valid_ratio<Num, Den...> && detail::positive_ratio<Num, Den...> && !detail::ratio_one<Num, Den...>)
struct power final
| Name |
|---|
_factor_ |
| Name |
|---|
_exponent_ |
Ratio must be mathematically valid and non-negative. Negative exponents are passed to per<...> with inverted sign (as positive exponents).
Den is an optional parameter to shorten the types presented to the user in the case when Den equals 1.
| Name | Description |
|---|---|
| F | factor to be raised to specified power |
| Num | Power ratio numerator |
| Den | [optional]Power ration denominator |
<mp-units/framework/symbolic_expression.h>
using _factor_ = F;
<mp-units/framework/symbolic_expression.h>
inline constexpr static
/* implementation-defined */ _exponent_ = {Num, Den...};
A prefixed unit
<mp-units/framework/unit.h>
template<
symbol_text Symbol,
UnitMagnitude auto M,
PrefixableUnit auto U>
requires (!Symbol.empty())
struct prefixed_unit
: ::_base_type_
| Name | Description |
|---|---|
::_base_type_ |
| Name |
|---|
_base_type_ |
| Name |
|---|
_symbol_ |
Defines a new unit that is a scaled version of another unit with the scaling factor specified by a predefined prefix.
For example:
{.cpp}
template<PrefixableUnit auto U>
struct kilo_ : prefixed_unit<"k", mag_power<10, 3>, U> {};
template<PrefixableUnit auto U>
constexpr kilo_<U> kilo;
inline constexpr auto kilogram = si::kilo<gram>;
| Name | Description |
|---|---|
| Symbol | a prefix text to prepend to a unit symbol |
| M | scaling factor of the prefix |
| U | a named unit to be prefixed |
<mp-units/framework/unit.h>
inline constexpr static
auto _symbol_ = Symbol + U._symbol_;
A quantity
<mp-units/framework/quantity.h>
template<
Reference auto R,
RepresentationOf<get_quantity_spec(R)> Rep>
class quantity;
| Name |
|---|
rep |
| Name | Description |
|---|---|
quantity [constructor] | Constructors |
~quantity [destructor] | Destructor |
operator= | Assignment operators |
force_in | |
force_numerical_value_in | |
in | |
numerical_value_in | |
numerical_value_ref_in | |
operator%= | Modulus assignment operator |
operator*= | Multiplication assignment operators |
operator+ | |
operator++ | Increment operators |
operator+= | Addition assignment operator |
operator- | |
operator-- | Decrement operators |
operator-= | Subtraction assignment operator |
operator/= | Division assignment operators |
operator | Conversion operators |
| Name |
|---|
max |
min |
zero |
| Name | Description |
|---|---|
numerical_value_is_an_implementation_detail_ | needs to be public for a structural type |
| Name |
|---|
dimension |
quantity_spec |
reference |
unit |
| Name | Description |
|---|---|
operator<=> |
Three-way comparison operator |
operator<=> |
Three-way comparison operator |
operator== |
Equality operator |
operator== |
Equality operator |
operator/ |
|
operator/ |
|
operator/ |
|
operator* |
|
operator* |
|
operator* |
|
operator% |
|
operator% |
|
operator% |
|
operator- |
|
operator- |
|
operator- |
|
operator+ |
|
operator+ |
|
operator+ |
| Name | Description |
|---|---|
abs | Computes the absolute value of a quantity |
cbrt | Computes the cubic root of a quantity |
ceil | Computes the smallest quantity with integer representation and unit type To with its number not less than q |
epsilon | Returns the epsilon of the quantity |
exp | Computes Euler's raised to the given power |
floor | Computes the largest quantity with integer representation and unit type To with its number not greater than q |
fma | Computes the fma of 3 quantities |
fma | Computes the fma of 2 quantities and a quantity point |
fmod | Computes the floating-point remainder of the division operation x / y. |
hypot | Computes the square root of the sum of the squares of x, y, and z, without undue overflow or underflow at intermediate stages of the computation |
hypot | Computes the square root of the sum of the squares of x and y, without undue overflow or underflow at intermediate stages of the computation |
inverse | Computes the inverse of a quantity in a provided unit |
isfinite | Determines if a quantity is finite. |
isinf | Determines if a quantity is infinite. |
isnan | Determines if a quantity is a nan. |
operator* | Multiplication operator |
pow | Computes the value of a quantity raised to the Num/Den power |
remainder | Computes the IEEE remainder of the floating point division operation x / y. |
round | Computes the nearest quantity with integer representation and unit type To to q |
sqrt | Computes the square root of a quantity |
value_cast | Explicit cast of a quantity's representation type |
Property of a phenomenon, body, or substance, where the property has a magnitude that can be expressed by means of a number and a reference.
| Name | Description |
|---|---|
| R | a reference of the quantity providing all information about quantity properties |
| Rep | a type to be used to represent values of a quantity |
<mp-units/framework/quantity.h>
using rep = Rep;
Constructors
<mp-units/framework/quantity.h>Default constructor
quantity() = default;
» more...
Copy constructor
quantity(quantity const& other) = default;
» more...
Copy constructor
template<
auto R2,
typename Rep2>
requires detail::QuantityConstructibleFrom<quantity, quantity<R2, Rep2>>
constexpr
explicit(!implicitly_convertible(get_quantity_spec(R2), quantity_spec) || !std::convertible_to<Rep2, rep>)
quantity(quantity<R2, Rep2> const& q);
» more...
Move constructor
quantity(quantity&& other) = default;
» more...
Construct from Q
template<QuantityLike Q>
requires detail::QuantityConstructibleFrom<quantity, detail::quantity_like_type<Q>>
constexpr
explicit(quantity_like_traits<Q>::explicit_import || !std::convertible_to<detail::quantity_like_type<Q>, quantity<R, Rep>>)
quantity(Q const& q);
» more...
Construct from FwdValue
template<typename FwdValue>
requires detail::DimensionlessOne<reference> && detail::ValuePreservingConstruction<rep, FwdValue>
constexpr
explicit(!std::convertible_to<FwdValue, rep>)
quantity(FwdValue&& val);
» more...
Constructor
template<
typename FwdValue,
Reference R2>
requires (equivalent(unit, get_unit(R2{}))) && detail::ValuePreservingConstruction<rep, FwdValue>
constexpr
quantity(
FwdValue&& val,
R2);
» more...
Constructor
template<
typename FwdValue,
Reference R2>
requires (!equivalent(unit, get_unit(R2{}))) &&
detail::QuantityConstructibleFrom<quantity, quantity<R2{}, std::remove_cvref_t<FwdValue>>>
constexpr
quantity(
FwdValue&& val,
R2);
» more...
Default constructor
<mp-units/framework/quantity.h>
quantity() = default;
Copy constructor
| Name | Description |
|---|---|
| other | The object to copy construct from |
Copy constructor
<mp-units/framework/quantity.h>
template<
auto R2,
typename Rep2>
requires detail::QuantityConstructibleFrom<quantity, quantity<R2, Rep2>>
constexpr
explicit(!implicitly_convertible(get_quantity_spec(R2), quantity_spec) || !std::convertible_to<Rep2, rep>)
quantity(quantity<R2, Rep2> const& q);
| Name | Description |
|---|---|
| q | The object to copy construct from |
Move constructor
| Name | Description |
|---|---|
| other | The object to move construct from |
Construct from Q
<mp-units/framework/quantity.h>
template<QuantityLike Q>
requires detail::QuantityConstructibleFrom<quantity, detail::quantity_like_type<Q>>
constexpr
explicit(quantity_like_traits<Q>::explicit_import || !std::convertible_to<detail::quantity_like_type<Q>, quantity<R, Rep>>)
quantity(Q const& q);
| Name | Description |
|---|---|
| q | The object to copy construct from |
Construct from FwdValue
<mp-units/framework/quantity.h>
template<typename FwdValue>
requires detail::DimensionlessOne<reference> && detail::ValuePreservingConstruction<rep, FwdValue>
constexpr
explicit(!std::convertible_to<FwdValue, rep>)
quantity(FwdValue&& val);
| Name | Description |
|---|---|
| val | The object to move construct from |
Constructor
<mp-units/framework/quantity.h>
template<
typename FwdValue,
Reference R2>
requires (equivalent(unit, get_unit(R2{}))) && detail::ValuePreservingConstruction<rep, FwdValue>
constexpr
quantity(
FwdValue&& val,
R2);
| Name | Description |
|---|---|
| val | The object to move construct from |
Constructor
<mp-units/framework/quantity.h>
template<
typename FwdValue,
Reference R2>
requires (!equivalent(unit, get_unit(R2{}))) &&
detail::QuantityConstructibleFrom<quantity, quantity<R2{}, std::remove_cvref_t<FwdValue>>>
constexpr
quantity(
FwdValue&& val,
R2);
| Name | Description |
|---|---|
| val | The object to move construct from |
Destructor
<mp-units/framework/quantity.h>
~quantity() = default;
Assignment operators
<mp-units/framework/quantity.h>Copy assignment operator
quantity&
operator=(quantity const& other) = default;
» more...
Move assignment operator
quantity&
operator=(quantity&& other) = default;
» more...
Assignment operator
template<typename FwdValue>
requires detail::DimensionlessOne<reference> && detail::ValuePreservingAssignment<rep, FwdValue>
constexpr
quantity&
operator=(FwdValue&& val);
» more...
Copy assignment operator
<mp-units/framework/quantity.h>
quantity&
operator=(quantity const& other) = default;
| Name | Description |
|---|---|
| other | The object to copy assign from |
Move assignment operator
<mp-units/framework/quantity.h>
quantity&
operator=(quantity&& other) = default;
| Name | Description |
|---|---|
| other | The object to move assign from |
Assignment operator
<mp-units/framework/quantity.h>
template<typename FwdValue>
requires detail::DimensionlessOne<reference> && detail::ValuePreservingAssignment<rep, FwdValue>
constexpr
quantity&
operator=(FwdValue&& val);
| Name | Description |
|---|---|
| val | The object to move assign from |
<mp-units/framework/quantity.h>
template<RepresentationOf<quantity_spec> ToRep>
requires std::constructible_from<ToRep, rep>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
force_in() const;
» more...
template</* implementation-defined */ ToU>
requires detail::SaneScaling<unit, ToU{}, rep>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
force_in(ToU) const;
» more...
template<
RepresentationOf<quantity_spec> ToRep,
/* implementation-defined */ ToU>
requires std::constructible_from<ToRep, rep> && detail::SaneScaling<unit, ToU{}, rep>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
force_in(ToU) const;
» more...
<mp-units/framework/quantity.h>
template<RepresentationOf<quantity_spec> ToRep>
requires std::constructible_from<ToRep, rep>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
force_in() const;
<mp-units/framework/quantity.h>
template</* implementation-defined */ ToU>
requires detail::SaneScaling<unit, ToU{}, rep>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
force_in(ToU) const;
<mp-units/framework/quantity.h>
template<
RepresentationOf<quantity_spec> ToRep,
/* implementation-defined */ ToU>
requires std::constructible_from<ToRep, rep> && detail::SaneScaling<unit, ToU{}, rep>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
force_in(ToU) const;
<mp-units/framework/quantity.h>
template</* implementation-defined */ U>
requires detail::SaneScaling<unit, U{}, rep>
[[nodiscard]]
constexpr
rep
force_numerical_value_in(U) const noexcept;
<mp-units/framework/quantity.h>
template<RepresentationOf<quantity_spec> ToRep>
requires detail::ValuePreservingConstruction<ToRep, rep>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
in() const;
» more...
template</* implementation-defined */ ToU>
requires detail::ValuePreservingScaling<unit, ToU{}, rep>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
in(ToU) const;
» more...
template<
RepresentationOf<quantity_spec> ToRep,
/* implementation-defined */ ToU>
requires detail::ValuePreservingConstruction<ToRep, rep> &&
detail::ValuePreservingConversion<unit, rep, ToU{}, ToRep>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
in(ToU) const;
» more...
<mp-units/framework/quantity.h>
template<RepresentationOf<quantity_spec> ToRep>
requires detail::ValuePreservingConstruction<ToRep, rep>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
in() const;
<mp-units/framework/quantity.h>
template</* implementation-defined */ ToU>
requires detail::ValuePreservingScaling<unit, ToU{}, rep>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
in(ToU) const;
<mp-units/framework/quantity.h>
template<
RepresentationOf<quantity_spec> ToRep,
/* implementation-defined */ ToU>
requires detail::ValuePreservingConstruction<ToRep, rep> &&
detail::ValuePreservingConversion<unit, rep, ToU{}, ToRep>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
in(ToU) const;
<mp-units/framework/quantity.h>
template</* implementation-defined */ U>
requires detail::ValuePreservingScaling<unit, U{}, rep>
[[nodiscard]]
constexpr
rep
numerical_value_in(U) const noexcept;
<mp-units/framework/quantity.h>
template<Unit U>
requires (equivalent(U{}, unit))
[[nodiscard]]
constexpr
rep&
numerical_value_ref_in(U) & noexcept;
» more...
template<Unit U>
requires (equivalent(U{}, unit))
[[nodiscard]]
constexpr
rep const&
numerical_value_ref_in(U) const & noexcept;
» more...
template<Unit U>
requires (equivalent(U{}, unit))
constexpr
rep const&&
numerical_value_ref_in(U) const && noexcept = delete;
» more...
<mp-units/framework/quantity.h>
template<Unit U>
requires (equivalent(U{}, unit))
[[nodiscard]]
constexpr
rep&
numerical_value_ref_in(U) & noexcept;
<mp-units/framework/quantity.h>
template<Unit U>
requires (equivalent(U{}, unit))
[[nodiscard]]
constexpr
rep const&
numerical_value_ref_in(U) const & noexcept;
<mp-units/framework/quantity.h>
template<Unit U>
requires (equivalent(U{}, unit))
constexpr
rep const&&
numerical_value_ref_in(U) const && noexcept = delete;
Modulus assignment operator
<mp-units/framework/quantity.h>
template<
auto R2,
typename Rep2>
requires (!treat_as_floating_point<rep>) && (implicitly_convertible(get_quantity_spec(R2), quantity_spec)) &&
detail::ValuePreservingConversion<get_unit(R2), Rep2, unit, rep> && requires(rep& a, const Rep2 b) {
{ a %= b } -> std::same_as<rep&>;
}
constexpr
quantity&
operator%=(quantity<R2, Rep2> const& other) &;
| Name | Description |
|---|---|
| other | The right operand |
Multiplication assignment operators
<mp-units/framework/quantity.h>Multiplication assignment operator
template</* implementation-defined */ Q2>
requires detail::ScalarValuePreservingTo<typename Q2::rep, rep> && requires(rep& a, const Q2::rep b) {
{ a *= b } -> std::same_as<rep&>;
}
constexpr
quantity&
operator*=(Q2 const& other) &;
» more...
Multiplication assignment operator
template</* implementation-defined */ Value>
requires requires(rep& a, const Value b) {
{ a *= b } -> std::same_as<rep&>;
}
constexpr
quantity&
operator*=(Value const& val) &;
» more...
Multiplication assignment operator
<mp-units/framework/quantity.h>
template</* implementation-defined */ Q2>
requires detail::ScalarValuePreservingTo<typename Q2::rep, rep> && requires(rep& a, const Q2::rep b) {
{ a *= b } -> std::same_as<rep&>;
}
constexpr
quantity&
operator*=(Q2 const& other) &;
| Name | Description |
|---|---|
| other | The right operand |
Multiplication assignment operator
<mp-units/framework/quantity.h>
template</* implementation-defined */ Value>
requires requires(rep& a, const Value b) {
{ a *= b } -> std::same_as<rep&>;
}
constexpr
quantity&
operator*=(Value const& val) &;
| Name | Description |
|---|---|
| val | The right operand |
<mp-units/framework/quantity.h>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
operator+() const
requires requires(const rep v) {
{ +v } -> std::common_with<rep>;
};
Increment operators
<mp-units/framework/quantity.h>Increment operator
constexpr
quantity&
operator++() &
requires requires(rep& v) {
{ ++v } -> std::same_as<rep&>;
};
» more...
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
operator++(int)
requires requires(rep& v) {
{ v++ } -> std::common_with<rep>;
};
» more...
Increment operator
<mp-units/framework/quantity.h>
constexpr
quantity&
operator++() &
requires requires(rep& v) {
{ ++v } -> std::same_as<rep&>;
};
<mp-units/framework/quantity.h>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
operator++(int)
requires requires(rep& v) {
{ v++ } -> std::common_with<rep>;
};
Addition assignment operator
<mp-units/framework/quantity.h>
template<
auto R2,
typename Rep2>
requires (implicitly_convertible(get_quantity_spec(R2), quantity_spec)) &&
detail::ValuePreservingConversion<get_unit(R2), Rep2, unit, rep> && requires(rep& a, const Rep2 b) {
{ a += b } -> std::same_as<rep&>;
}
constexpr
quantity&
operator+=(quantity<R2, Rep2> const& other) &;
| Name | Description |
|---|---|
| other | The right operand |
<mp-units/framework/quantity.h>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
operator-() const
requires requires(const rep v) {
{ -v } -> std::common_with<rep>;
};
Decrement operators
<mp-units/framework/quantity.h>Decrement operator
constexpr
quantity&
operator--() &
requires requires(rep& v) {
{ --v } -> std::same_as<rep&>;
};
» more...
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
operator--(int)
requires requires(rep& v) {
{ v-- } -> std::common_with<rep>;
};
» more...
Decrement operator
<mp-units/framework/quantity.h>
constexpr
quantity&
operator--() &
requires requires(rep& v) {
{ --v } -> std::same_as<rep&>;
};
<mp-units/framework/quantity.h>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
operator--(int)
requires requires(rep& v) {
{ v-- } -> std::common_with<rep>;
};
Subtraction assignment operator
<mp-units/framework/quantity.h>
template<
auto R2,
typename Rep2>
requires (implicitly_convertible(get_quantity_spec(R2), quantity_spec)) &&
detail::ValuePreservingConversion<get_unit(R2), Rep2, unit, rep> && requires(rep& a, const Rep2 b) {
{ a -= b } -> std::same_as<rep&>;
}
constexpr
quantity&
operator-=(quantity<R2, Rep2> const& other) &;
| Name | Description |
|---|---|
| other | The right operand |
Division assignment operators
<mp-units/framework/quantity.h>Division assignment operator
template</* implementation-defined */ Q2>
requires detail::ScalarValuePreservingTo<typename Q2::rep, rep> && requires(rep& a, const Q2::rep b) {
{ a /= b } -> std::same_as<rep&>;
}
constexpr
quantity&
operator/=(Q2 const& rhs) &;
» more...
Division assignment operator
template</* implementation-defined */ Value>
requires requires(rep& a, const Value b) {
{ a /= b } -> std::same_as<rep&>;
}
constexpr
quantity&
operator/=(Value const& val) &;
» more...
Division assignment operator
<mp-units/framework/quantity.h>
template</* implementation-defined */ Q2>
requires detail::ScalarValuePreservingTo<typename Q2::rep, rep> && requires(rep& a, const Q2::rep b) {
{ a /= b } -> std::same_as<rep&>;
}
constexpr
quantity&
operator/=(Q2 const& rhs) &;
| Name | Description |
|---|---|
| rhs | The right operand |
Division assignment operator
<mp-units/framework/quantity.h>
template</* implementation-defined */ Value>
requires requires(rep& a, const Value b) {
{ a /= b } -> std::same_as<rep&>;
}
constexpr
quantity&
operator/=(Value const& val) &;
| Name | Description |
|---|---|
| val | The right operand |
Conversion operators
<mp-units/framework/quantity.h>Conversion to Q_
template<
typename Q_,
QuantityLike Q = std::remove_cvref_t<Q_>>
requires detail::QuantityConstructibleFrom<detail::quantity_like_type<Q>, quantity>
[[nodiscard]]
constexpr
explicit(quantity_like_traits<Q>::explicit_export || !std::convertible_to<quantity<R, Rep>, detail::quantity_like_type<Q>>)
operator Q_() const noexcept(noexcept(quantity_like_traits<Q>::from_numerical_value(this->numerical_value_is_an_implementation_detail_)) && std::is_nothrow_copy_constructible_v<rep>);
» more...
Conversion to V_
template<
typename V_,
std::constructible_from<rep> Value = std::remove_cvref_t<V_>>
requires detail::DimensionlessOne<reference>
[[nodiscard]]
constexpr
explicit
operator V_() const & noexcept;
» more...
Conversion to Q_
<mp-units/framework/quantity.h>
template<
typename Q_,
QuantityLike Q = std::remove_cvref_t<Q_>>
requires detail::QuantityConstructibleFrom<detail::quantity_like_type<Q>, quantity>
[[nodiscard]]
constexpr
explicit(quantity_like_traits<Q>::explicit_export || !std::convertible_to<quantity<R, Rep>, detail::quantity_like_type<Q>>)
operator Q_() const noexcept(noexcept(quantity_like_traits<Q>::from_numerical_value(this->numerical_value_is_an_implementation_detail_)) && std::is_nothrow_copy_constructible_v<rep>);
Q_
Conversion to V_
<mp-units/framework/quantity.h>
template<
typename V_,
std::constructible_from<rep> Value = std::remove_cvref_t<V_>>
requires detail::DimensionlessOne<reference>
[[nodiscard]]
constexpr
explicit
operator V_() const & noexcept;
V_
<mp-units/framework/quantity.h>
[[nodiscard]]
constexpr
static
quantity
max() noexcept
requires requires { representation_values<rep>::max(); };
<mp-units/framework/quantity.h>
[[nodiscard]]
constexpr
static
quantity
min() noexcept
requires requires { representation_values<rep>::min(); };
<mp-units/framework/quantity.h>
[[nodiscard]]
constexpr
static
quantity
zero() noexcept
requires requires { representation_values<rep>::zero(); };
needs to be public for a structural type
<mp-units/framework/quantity.h>
Rep numerical_value_is_an_implementation_detail_;
<mp-units/framework/quantity.h>
inline constexpr static
Dimension auto dimension = quantity_spec.dimension;
<mp-units/framework/quantity.h>
inline constexpr static
QuantitySpec auto quantity_spec = get_quantity_spec(reference);
<mp-units/framework/quantity.h>
inline constexpr static
Reference auto reference = R;
<mp-units/framework/quantity.h>
inline constexpr static
Unit auto unit = get_unit(reference);
Provides support for external quantity-like types
<mp-units/framework/customization_points.h>
template<typename T>
struct quantity_like_traits;
The type trait should provide the reference object, a type alias rep, and static member functions to_numerical_value(T) that returns the raw value of the quantity and from_numerical_value(rep) that returns T from rep.
If the following expression is true, the specified conversion will be explicit: - explicit_import for the conversion from T to a quantity type, - explicit_export for the conversion from a quantity type to T.
Usage example can be found in mp-units/systems/si/chrono.h header file.
| Name | Description |
|---|---|
| T | the type to provide support for |
A quantity point
<mp-units/framework/quantity_point.h>
template<
Reference auto R,
PointOriginFor<get_quantity_spec(R)> auto PO,
RepresentationOf<get_quantity_spec(R)> Rep>
class quantity_point;
| Name |
|---|
quantity_type |
rep |
| Name | Description |
|---|---|
quantity_point [constructor] | Constructors |
~quantity_point [destructor] | Destructor |
operator= | Assignment operators |
force_in | |
in | |
operator++ | Increment operators |
operator+= | Addition assignment operator |
operator-- | Decrement operators |
operator-= | Subtraction assignment operator |
point_for | |
quantity_from | |
quantity_from_zero | |
quantity_ref_from | |
operator | Conversion operators |
| Name |
|---|
max |
min |
| Name |
|---|
quantity_from_origin_is_an_implementation_detail_ |
| Name |
|---|
absolute_point_origin |
dimension |
point_origin |
quantity_spec |
reference |
unit |
| Name | Description |
|---|---|
operator<=> |
Three-way comparison operator |
operator== |
Equality operator |
operator- |
|
operator- |
|
operator- |
|
operator- |
|
operator+ |
|
operator+ |
| Name | Description |
|---|---|
isfinite | Determines if a quantity point is finite. |
isinf | Determines if a quantity point is infinite. |
isnan | Determines if a quantity point is a nan. |
lerp | Linear interpolation or extrapolation |
midpoint | Computes the midpoint of two points |
value_cast | Explicit cast of a quantity point's representation type |
An absolute quantity measured from an origin.
| Name | Description |
|---|---|
| R | a reference of the quantity point providing all information about quantity properties |
| PO | a type that represents the origin point from which the quantity point is measured from |
| Rep | a type to be used to represent values of a quantity point |
<mp-units/framework/quantity_point.h>
using quantity_type = quantity<reference, Rep>;
<mp-units/framework/quantity_point.h>
using rep = Rep;
Constructors
<mp-units/framework/quantity_point.h>Default constructor
quantity_point() = default;
» more...
Copy constructor
quantity_point(quantity_point const& other) = default;
» more...
Move constructor
quantity_point(quantity_point&& other) = default;
» more...
Construct from QP
template<QuantityPointLike QP>
requires (quantity_point_like_traits<QP>::point_origin == point_origin) &&
std::constructible_from<quantity_type, quantity<quantity_point_like_traits<QP>::reference,
typename quantity_point_like_traits<QP>::rep>>
constexpr
explicit(quantity_point_like_traits<QP>::explicit_import || !std::convertible_to<quantity<quantity_point_like_traits<QP>::reference, typename quantity_point_like_traits<QP>::rep>, quantity_type>)
quantity_point(QP const& qp);
» more...
Construct from QP
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(QP const& qp);
» more...
Construct from FwdQ
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))
constexpr
explicit
quantity_point(FwdQ&& q);
» more...
Constructor
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));
» more...
Constructor
template<
typename FwdQ,
PointOrigin PO2,
QuantityOf<PO2::_quantity_spec_> Q = std::remove_cvref_t<FwdQ>>
requires std::constructible_from<quantity_type, FwdQ> && detail::SameAbsolutePointOriginAs<PO2, PO>
constexpr
quantity_point(
FwdQ&& q,
PO2);
» more...
Default constructor
<mp-units/framework/quantity_point.h>
quantity_point() = default;
Copy constructor
<mp-units/framework/quantity_point.h>
quantity_point(quantity_point const& other) = default;
| Name | Description |
|---|---|
| other | The object to copy construct from |
Move constructor
<mp-units/framework/quantity_point.h>
quantity_point(quantity_point&& other) = default;
| Name | Description |
|---|---|
| other | The object to move construct from |
Construct from QP
<mp-units/framework/quantity_point.h>
template<QuantityPointLike QP>
requires (quantity_point_like_traits<QP>::point_origin == point_origin) &&
std::constructible_from<quantity_type, quantity<quantity_point_like_traits<QP>::reference,
typename quantity_point_like_traits<QP>::rep>>
constexpr
explicit(quantity_point_like_traits<QP>::explicit_import || !std::convertible_to<quantity<quantity_point_like_traits<QP>::reference, typename quantity_point_like_traits<QP>::rep>, quantity_type>)
quantity_point(QP const& qp);
| Name | Description |
|---|---|
| qp | The object to copy construct from |
Construct from QP
<mp-units/framework/quantity_point.h>
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(QP const& qp);
| Name | Description |
|---|---|
| qp | The object to copy construct from |
Construct from FwdQ
<mp-units/framework/quantity_point.h>
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))
constexpr
explicit
quantity_point(FwdQ&& q);
| Name | Description |
|---|---|
| q | The object to move construct from |
Constructor
<mp-units/framework/quantity_point.h>
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));
| Name | Description |
|---|---|
| q | The object to move construct from |
Constructor
<mp-units/framework/quantity_point.h>
template<
typename FwdQ,
PointOrigin PO2,
QuantityOf<PO2::_quantity_spec_> Q = std::remove_cvref_t<FwdQ>>
requires std::constructible_from<quantity_type, FwdQ> && detail::SameAbsolutePointOriginAs<PO2, PO>
constexpr
quantity_point(
FwdQ&& q,
PO2);
| Name | Description |
|---|---|
| q | The object to move construct from |
Destructor
<mp-units/framework/quantity_point.h>
~quantity_point() = default;
Assignment operators
<mp-units/framework/quantity_point.h>Copy assignment operator
quantity_point&
operator=(quantity_point const& other) = default;
» more...
Move assignment operator
quantity_point&
operator=(quantity_point&& other) = default;
» more...
Copy assignment operator
<mp-units/framework/quantity_point.h>
quantity_point&
operator=(quantity_point const& other) = default;
| Name | Description |
|---|---|
| other | The object to copy assign from |
Move assignment operator
<mp-units/framework/quantity_point.h>
quantity_point&
operator=(quantity_point&& other) = default;
| Name | Description |
|---|---|
| other | The object to move assign from |
<mp-units/framework/quantity_point.h>
template<RepresentationOf<quantity_spec> ToRep>
requires std::constructible_from<ToRep, rep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_spec> auto
force_in() const;
» more...
template</* implementation-defined */ ToU>
requires detail::SaneScaling<unit, ToU{}, rep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_spec> auto
force_in(ToU) const;
» more...
template<
RepresentationOf<quantity_spec> ToRep,
/* implementation-defined */ ToU>
requires std::constructible_from<ToRep, rep> && detail::SaneScaling<unit, ToU{}, rep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_spec> auto
force_in(ToU) const;
» more...
<mp-units/framework/quantity_point.h>
template<RepresentationOf<quantity_spec> ToRep>
requires std::constructible_from<ToRep, rep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_spec> auto
force_in() const;
<mp-units/framework/quantity_point.h>
template</* implementation-defined */ ToU>
requires detail::SaneScaling<unit, ToU{}, rep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_spec> auto
force_in(ToU) const;
<mp-units/framework/quantity_point.h>
template<
RepresentationOf<quantity_spec> ToRep,
/* implementation-defined */ ToU>
requires std::constructible_from<ToRep, rep> && detail::SaneScaling<unit, ToU{}, rep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_spec> auto
force_in(ToU) const;
<mp-units/framework/quantity_point.h>
template<RepresentationOf<quantity_spec> ToRep>
requires detail::ValuePreservingConstruction<ToRep, rep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_spec> auto
in() const;
» more...
template</* implementation-defined */ ToU>
requires detail::ValuePreservingScaling<unit, ToU{}, rep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_spec> auto
in(ToU) const;
» more...
template<
RepresentationOf<quantity_spec> ToRep,
/* implementation-defined */ ToU>
requires detail::ValuePreservingConstruction<ToRep, rep> &&
detail::ValuePreservingConversion<unit, rep, ToU{}, ToRep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_spec> auto
in(ToU) const;
» more...
<mp-units/framework/quantity_point.h>
template<RepresentationOf<quantity_spec> ToRep>
requires detail::ValuePreservingConstruction<ToRep, rep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_spec> auto
in() const;
<mp-units/framework/quantity_point.h>
template</* implementation-defined */ ToU>
requires detail::ValuePreservingScaling<unit, ToU{}, rep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_spec> auto
in(ToU) const;
<mp-units/framework/quantity_point.h>
template<
RepresentationOf<quantity_spec> ToRep,
/* implementation-defined */ ToU>
requires detail::ValuePreservingConstruction<ToRep, rep> &&
detail::ValuePreservingConversion<unit, rep, ToU{}, ToRep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_spec> auto
in(ToU) const;
Increment operators
<mp-units/framework/quantity_point.h>Increment operator
constexpr
quantity_point&
operator++() &
requires requires { ++quantity_from_origin_is_an_implementation_detail_; };
» more...
Increment operator
[[nodiscard]]
constexpr
quantity_point
operator++(int)
requires requires { quantity_from_origin_is_an_implementation_detail_++; };
» more...
Increment operator
<mp-units/framework/quantity_point.h>
constexpr
quantity_point&
operator++() &
requires requires { ++quantity_from_origin_is_an_implementation_detail_; };
Increment operator
<mp-units/framework/quantity_point.h>
[[nodiscard]]
constexpr
quantity_point
operator++(int)
requires requires { quantity_from_origin_is_an_implementation_detail_++; };
Addition assignment operator
<mp-units/framework/quantity_point.h>
template<
auto R2,
typename Rep2>
requires (implicitly_convertible(get_quantity_spec(R2), quantity_spec)) &&
detail::ValuePreservingConversion<get_unit(R2), Rep2, unit, rep> &&
requires(const quantity_type q) { quantity_from_origin_is_an_implementation_detail_ += q; }
constexpr
quantity_point&
operator+=(quantity<R2, Rep2> const& q) &;
| Name | Description |
|---|---|
| q | The right operand |
Decrement operators
<mp-units/framework/quantity_point.h>Decrement operator
constexpr
quantity_point&
operator--() &
requires requires { --quantity_from_origin_is_an_implementation_detail_; };
» more...
Decrement operator
[[nodiscard]]
constexpr
quantity_point
operator--(int)
requires requires { quantity_from_origin_is_an_implementation_detail_--; };
» more...
Decrement operator
<mp-units/framework/quantity_point.h>
constexpr
quantity_point&
operator--() &
requires requires { --quantity_from_origin_is_an_implementation_detail_; };
Decrement operator
<mp-units/framework/quantity_point.h>
[[nodiscard]]
constexpr
quantity_point
operator--(int)
requires requires { quantity_from_origin_is_an_implementation_detail_--; };
Subtraction assignment operator
<mp-units/framework/quantity_point.h>
template<
auto R2,
typename Rep2>
requires (implicitly_convertible(get_quantity_spec(R2), quantity_spec)) &&
detail::ValuePreservingConversion<get_unit(R2), Rep2, unit, rep> &&
requires(const quantity_type q) { quantity_from_origin_is_an_implementation_detail_ -= q; }
constexpr
quantity_point&
operator-=(quantity<R2, Rep2> const& q) &;
| Name | Description |
|---|---|
| q | The right operand |
<mp-units/framework/quantity_point.h>
template</* implementation-defined */ NewPO>
[[nodiscard]]
constexpr
QuantityPointOf<(NewPO{})> auto
point_for(NewPO new_origin) const;
<mp-units/framework/quantity_point.h>
template<PointOrigin PO2>
requires requires(const quantity_point qp) { qp - PO2{}; }
[[nodiscard]]
constexpr
Quantity auto
quantity_from(PO2) const;
» more...
template<QuantityPointOf<absolute_point_origin> QP>
[[nodiscard]]
constexpr
Quantity auto
quantity_from(QP const& qp) const;
» more...
<mp-units/framework/quantity_point.h>
template<PointOrigin PO2>
requires requires(const quantity_point qp) { qp - PO2{}; }
[[nodiscard]]
constexpr
Quantity auto
quantity_from(PO2) const;
<mp-units/framework/quantity_point.h>
template<QuantityPointOf<absolute_point_origin> QP>
[[nodiscard]]
constexpr
Quantity auto
quantity_from(QP const& qp) const;
<mp-units/framework/quantity_point.h>
[[nodiscard]]
constexpr
Quantity auto
quantity_from_zero() const;
<mp-units/framework/quantity_point.h>
template<PointOrigin PO2>
requires (PO2{} == point_origin)
[[nodiscard]]
constexpr
quantity_type&
quantity_ref_from(PO2) & noexcept;
» more...
template<PointOrigin PO2>
requires (PO2{} == point_origin)
[[nodiscard]]
constexpr
quantity_type const&
quantity_ref_from(PO2) const & noexcept;
» more...
template<PointOrigin PO2>
requires (PO2{} == point_origin)
constexpr
quantity_type const&&
quantity_ref_from(PO2) const && noexcept = delete;
» more...
<mp-units/framework/quantity_point.h>
template<PointOrigin PO2>
requires (PO2{} == point_origin)
[[nodiscard]]
constexpr
quantity_type&
quantity_ref_from(PO2) & noexcept;
<mp-units/framework/quantity_point.h>
template<PointOrigin PO2>
requires (PO2{} == point_origin)
[[nodiscard]]
constexpr
quantity_type const&
quantity_ref_from(PO2) const & noexcept;
<mp-units/framework/quantity_point.h>
template<PointOrigin PO2>
requires (PO2{} == point_origin)
constexpr
quantity_type const&&
quantity_ref_from(PO2) const && noexcept = delete;
Conversion operators
<mp-units/framework/quantity_point.h>Conversion to QP_
template<
typename QP_,
QuantityPointLike QP = std::remove_cvref_t<QP_>>
requires (point_origin == quantity_point_like_traits<QP>::point_origin) &&
std::convertible_to<quantity_type, quantity<quantity_point_like_traits<QP>::reference,
typename quantity_point_like_traits<QP>::rep>>
[[nodiscard]]
constexpr
explicit(quantity_point_like_traits<QP>::explicit_export || !std::convertible_to<quantity_type, quantity<quantity_point_like_traits<QP>::reference, typename quantity_point_like_traits<QP>::rep>>)
operator QP_() const & noexcept(noexcept(quantity_point_like_traits<QP>::from_numerical_value(this->quantity_from_origin_is_an_implementation_detail_.numerical_value_is_an_implementation_detail_)) && std::is_nothrow_copy_constructible_v<rep>);
» more...
Conversion to QP_
template<
typename QP_,
QuantityPointLike QP = std::remove_cvref_t<QP_>>
requires (point_origin == quantity_point_like_traits<QP>::point_origin) &&
std::convertible_to<quantity_type, quantity<quantity_point_like_traits<QP>::reference,
typename quantity_point_like_traits<QP>::rep>>
[[nodiscard]]
constexpr
explicit(quantity_point_like_traits<QP>::explicit_export || !std::convertible_to<quantity_type, quantity<quantity_point_like_traits<QP>::reference, typename quantity_point_like_traits<QP>::rep>>)
operator QP_() && noexcept(noexcept(quantity_point_like_traits<QP>::from_numerical_value(this->quantity_from_origin_is_an_implementation_detail_.numerical_value_is_an_implementation_detail_)) && std::is_nothrow_move_constructible_v<rep>);
» more...
Conversion to QP_
<mp-units/framework/quantity_point.h>
template<
typename QP_,
QuantityPointLike QP = std::remove_cvref_t<QP_>>
requires (point_origin == quantity_point_like_traits<QP>::point_origin) &&
std::convertible_to<quantity_type, quantity<quantity_point_like_traits<QP>::reference,
typename quantity_point_like_traits<QP>::rep>>
[[nodiscard]]
constexpr
explicit(quantity_point_like_traits<QP>::explicit_export || !std::convertible_to<quantity_type, quantity<quantity_point_like_traits<QP>::reference, typename quantity_point_like_traits<QP>::rep>>)
operator QP_() const & noexcept(noexcept(quantity_point_like_traits<QP>::from_numerical_value(this->quantity_from_origin_is_an_implementation_detail_.numerical_value_is_an_implementation_detail_)) && std::is_nothrow_copy_constructible_v<rep>);
QP_
Conversion to QP_
<mp-units/framework/quantity_point.h>
template<
typename QP_,
QuantityPointLike QP = std::remove_cvref_t<QP_>>
requires (point_origin == quantity_point_like_traits<QP>::point_origin) &&
std::convertible_to<quantity_type, quantity<quantity_point_like_traits<QP>::reference,
typename quantity_point_like_traits<QP>::rep>>
[[nodiscard]]
constexpr
explicit(quantity_point_like_traits<QP>::explicit_export || !std::convertible_to<quantity_type, quantity<quantity_point_like_traits<QP>::reference, typename quantity_point_like_traits<QP>::rep>>)
operator QP_() && noexcept(noexcept(quantity_point_like_traits<QP>::from_numerical_value(this->quantity_from_origin_is_an_implementation_detail_.numerical_value_is_an_implementation_detail_)) && std::is_nothrow_move_constructible_v<rep>);
QP_
<mp-units/framework/quantity_point.h>
[[nodiscard]]
constexpr
static
quantity_point
max() noexcept
requires requires { quantity_type::max(); };
<mp-units/framework/quantity_point.h>
[[nodiscard]]
constexpr
static
quantity_point
min() noexcept
requires requires { quantity_type::min(); };
<mp-units/framework/quantity_point.h>
quantity_type quantity_from_origin_is_an_implementation_detail_;
<mp-units/framework/quantity_point.h>
inline constexpr static
PointOrigin auto absolute_point_origin = detail::get_absolute_point_origin(PO);
<mp-units/framework/quantity_point.h>
inline constexpr static
Dimension auto dimension = quantity_spec.dimension;
<mp-units/framework/quantity_point.h>
inline constexpr static
PointOrigin auto point_origin = PO;
<mp-units/framework/quantity_point.h>
inline constexpr static
QuantitySpec auto quantity_spec = get_quantity_spec(reference);
<mp-units/framework/quantity_point.h>
inline constexpr static
Reference auto reference = R;
<mp-units/framework/quantity_point.h>
inline constexpr static
Unit auto unit = get_unit(reference);
Provides support for external quantity point-like types
<mp-units/framework/customization_points.h>
template<typename T>
struct quantity_point_like_traits;
The type trait should provide nested reference and origin objects, a type alias rep, and static member functions to_numerical_value(T) that returns the raw value of the the quantity being the offset of the point from the origin and from_numerical_value(rep) that returns T formed this raw value.
If the following expression is true, the specified conversion will be explicit: - explicit_import for the conversion from T to a quantity_point type, - explicit_export for the conversion from a quantity_point type to T.
Usage example can be found in mp-units/systems/si/chrono.h header file.
| Name | Description |
|---|---|
| T | the type to provide support for |
<mp-units/framework/quantity_spec.h>
template<auto...>
struct quantity_spec;
| Name | Description |
|---|---|
dimensionless
| Quantity of dimension one |
<mp-units/framework/quantity_spec.h>
template<
/* implementation-defined */ auto Dim,
/* implementation-defined */ auto Args...>
struct quantity_spec<QS, Args...>
: /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ |
| Name |
|---|
_base_type_ |
| Name |
|---|
_equation_ |
_parent_ |
character |
dimension |
<mp-units/framework/quantity_spec.h>
inline constexpr static
auto _equation_ = Eq;
<mp-units/framework/quantity_spec.h>
inline constexpr static
auto _parent_ = QS;
<mp-units/framework/quantity_spec.h>
inline constexpr static
quantity_character character = detail::quantity_character_init<Args...>(QS.character);
<mp-units/framework/quantity_spec.h>
inline constexpr static
Dimension auto dimension = _parent_.dimension;
<mp-units/framework/quantity_spec.h>
template<
/* implementation-defined */ auto QS,
/* implementation-defined */ auto Eq,
/* implementation-defined */ auto Args...>
requires (explicitly_convertible(Eq, QS))
struct quantity_spec<QS, Eq, Args...>
: /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ |
| Name |
|---|
_base_type_ |
| Name |
|---|
_equation_ |
_parent_ |
character |
dimension |
<mp-units/framework/quantity_spec.h>
inline constexpr static
auto _equation_ = Eq;
<mp-units/framework/quantity_spec.h>
inline constexpr static
auto _parent_ = QS;
<mp-units/framework/quantity_spec.h>
inline constexpr static
quantity_character character = detail::quantity_character_init<Args...>(Eq.character);
<mp-units/framework/quantity_spec.h>
inline constexpr static
Dimension auto dimension = _parent_.dimension;
Quantity reference type
<mp-units/framework/reference.h>
template<
QuantitySpec Q,
Unit U>
struct reference;
| Name | Description |
|---|---|
cbrt |
|
sqrt |
|
pow |
Computes the value of a reference raised to the Num/Den power |
inverse |
|
operator/ |
|
operator/ |
|
operator/ |
|
operator* |
|
operator* |
|
operator* |
|
operator== |
Equality operator |
operator== |
Equality operator |
Quantity reference describes all the properties of a quantity besides its representation type.
In most cases this class template is not explicitly instantiated by the user. It is implicitly instantiated by the library's framework while binding a quantity specification with a compatible unit.
{.cpp}
Reference auto kmph = isq::speed[km / h];
QuantityOf<isq::speed[km / h]> auto speed = 90 * kmph;
The following syntaxes are not allowed: 2 / kmph, kmph * 3, kmph / 4, 70 * isq::length[km] / isq:time[h].
<mp-units/framework/quantity_point.h>
template<QuantityPoint auto QP>
struct relative_point_origin
: /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ |
| Name |
|---|
_absolute_point_origin_ |
_quantity_point_ |
_quantity_spec_ |
<mp-units/framework/quantity_point.h>
inline constexpr static
PointOrigin auto _absolute_point_origin_ = QP.absolute_point_origin;
<mp-units/framework/quantity_point.h>
inline constexpr static
QuantityPoint auto _quantity_point_ = QP;
<mp-units/framework/quantity_point.h>
inline constexpr static
QuantitySpec auto _quantity_spec_ = []() {
// select the strongest of specs
if constexpr (detail::QuantityKindSpec<MP_UNITS_NONCONST_TYPE(QP.quantity_spec)>)
return QP.point_origin._quantity_spec_;
else
return QP.quantity_spec;
}();
A type trait that defines zero, one, min, and max for a representation type
<mp-units/framework/customization_points.h>
template<typename Rep>
struct representation_values
: std::chrono::duration_values<Rep>
| Name | Description |
|---|---|
std::chrono::duration_values<Rep> |
| Name |
|---|
one |
The zero, one, min, and max member functions in mp_units::quantity forward their work to these methods. This type can be specialized if the representation Rep requires a specific implementation to return these quantity objects.
| Name | Description |
|---|---|
| Rep | a representation type for which a type trait is defined |
<mp-units/framework/customization_points.h>
constexpr
static
Rep
one() noexcept
requires std::constructible_from<Rep, int>;
Unit being a scaled version of another unit
<mp-units/framework/unit.h>
template<
UnitMagnitude auto M,
Unit U>
requires (M != detail::unit_magnitude<>{} && M != mag<1>)
struct scaled_unit final
: /* implementation-defined */
| Name | Description |
|---|---|
/* implementation-defined */ |
User should not instantiate this type! It is not exported from the C++ module. The library will instantiate this type automatically based on the unit arithmetic equation provided by the user.
| Name | Description |
|---|---|
| M | magnitude describing the scale factor |
| U | reference unit being scaled |
<mp-units/random.h>
struct student_t_distribution
: std::student_t_distribution<Q::rep>
| Name | Description |
|---|---|
std::student_t_distribution<Q::rep> |
| Name |
|---|
base |
rep |
| Name | Description |
|---|---|
student_t_distribution [constructor] | Constructors |
max | |
min | |
operator() |
<mp-units/random.h>
using base = std::student_t_distribution<rep>;
<mp-units/random.h>
using rep = Q::rep;
Constructors
<mp-units/random.h>Default constructor
student_t_distribution();
» more...
Construct from rep
explicit
student_t_distribution(rep const& n);
» more...
Default constructor
<mp-units/random.h>
student_t_distribution();
Construct from rep
| Name | Description |
|---|---|
| n | The object to copy construct from |
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
template<Quantity Q>
requires std::floating_point<typename Q::rep>
struct student_t_distribution
: std::student_t_distribution<Q::rep>
| Name | Description |
|---|---|
std::student_t_distribution<Q::rep> |
A symbol text representation
<mp-units/framework/symbol_text.h>
template<
std::size_t N,
std::size_t M>
class symbol_text;
| Name | Description |
|---|---|
symbol_text [constructor] | Constructors |
ascii | |
empty | |
portable | |
unicode | |
utf8 |
| Name |
|---|
portable_ |
utf8_ |
| Name | Description |
|---|---|
operator== |
Equality operator |
operator<=> |
Three-way comparison operator |
operator+ |
Addition operator |
This class template is responsible for definition and handling of a symbol text representation. In the libary it is used to define symbols of units and prefixes. Each symbol can have two versions: UTF-8 and portable.
| Name | Description |
|---|---|
| N | The size of a UTF-8 symbol |
| M | The size of the portable symbol |
Constructors
<mp-units/framework/symbol_text.h>Construct from char
constexpr
explicit(false)
symbol_text(char ch);
» more...
Construct from fixed_string
constexpr
explicit(false)
symbol_text(fixed_string<N> const& txt);
» more...
Construct from char
consteval
explicit(false)
symbol_text(char const(& txt)[]);
» more...
constexpr
symbol_text(
fixed_u8string<N> const& utf8,
fixed_string<M> const& portable);
» more...
consteval
symbol_text(
char8_t const(& u)[],
char const(& a)[]);
» more...
Construct from char
<mp-units/framework/symbol_text.h>
constexpr
explicit(false)
symbol_text(char ch);
| Name | Description |
|---|---|
| ch | The value to construct from |
Construct from fixed_string
<mp-units/framework/symbol_text.h>
constexpr
explicit(false)
symbol_text(fixed_string<N> const& txt);
| Name | Description |
|---|---|
| txt | The object to copy construct from |
Construct from char
<mp-units/framework/symbol_text.h>
consteval
explicit(false)
symbol_text(char const(& txt)[]);
| Name | Description |
|---|---|
| txt | The value to construct from |
<mp-units/framework/symbol_text.h>
constexpr
symbol_text(
fixed_u8string<N> const& utf8,
fixed_string<M> const& portable);
<mp-units/framework/symbol_text.h>
consteval
symbol_text(
char8_t const(& u)[],
char const(& a)[]);
<mp-units/framework/symbol_text.h>
[[deprecated]]
constexpr
auto const&
ascii() const;
<mp-units/framework/symbol_text.h>
[[nodiscard]]
constexpr
bool
empty() const;
<mp-units/framework/symbol_text.h>
[[nodiscard]]
constexpr
auto const&
portable() const;
<mp-units/framework/symbol_text.h>
[[deprecated]]
constexpr
auto const&
unicode() const;
<mp-units/framework/symbol_text.h>
[[nodiscard]]
constexpr
auto const&
utf8() const;
System-specific reference
<mp-units/framework/system_reference.h>
template<
QuantitySpec auto Q,
Unit auto CoU>
requires (!MP_UNITS_ASSOCIATED_UNIT_T(decltype(CoU))) || (CoU == one)
struct system_reference;
| Name | Description |
|---|---|
operator[] | Subscript operator |
| Name |
|---|
coherent_unit |
quantity_spec |
This type is used in rare cases where more than one base quantity in a specific system of units uses the same unit. For example in a hypothetical system of natural units where constant for speed of light c = 1, length and time could be measured in seconds. In such cases system_reference has to be used to explicitly express such a binding.
For example:
{.cpp}
// hypothetical natural system of units for c=1
inline constexpr struct second final : named_unit<"s"> {} second;
inline constexpr struct minute final : named_unit<"min", mag<60> * second> {} minute;
inline constexpr struct gram final : named_unit<"g"> {} gram;
inline constexpr auto kilogram = si::kilo<gram>;
inline constexpr struct time : system_reference<isq::time, second> {} time;
inline constexpr struct length : system_reference<isq::length, second> {} length;
inline constexpr struct speed : system_reference<isq::speed, second / second> {} speed;
inline constexpr struct force : system_reference<isq::force, kilogram / second> {} force;
| Name | Description |
|---|---|
| Q | quantity for which a unit is being assigned |
| CoU | coherent unit for a quantity in this system |
Subscript operator
<mp-units/framework/system_reference.h>
template</* implementation-defined */ U>
[[nodiscard]]
constexpr
reference<decltype(Q), U>
operator[](U rhs) const;
| Name | Description |
|---|---|
| rhs | The right operand |
<mp-units/framework/system_reference.h>
inline constexpr static
auto coherent_unit = CoU;
<mp-units/framework/system_reference.h>
inline constexpr static
auto quantity_spec = Q;
<mp-units/random.h>
struct uniform_int_distribution
: std::uniform_int_distribution<Q::rep>
| Name | Description |
|---|---|
std::uniform_int_distribution<Q::rep> |
| Name |
|---|
base |
rep |
| Name | Description |
|---|---|
uniform_int_distribution [constructor] | Constructors |
a | |
b | |
max | |
min | |
operator() |
<mp-units/random.h>
using base = std::uniform_int_distribution<rep>;
<mp-units/random.h>
using rep = Q::rep;
Constructors
<mp-units/random.h>Default constructor
uniform_int_distribution();
» more...
uniform_int_distribution(
Q const& a,
Q const& b);
» more...
Default constructor
<mp-units/random.h>
uniform_int_distribution();
<mp-units/random.h>
uniform_int_distribution(
Q const& a,
Q const& b);
<mp-units/random.h>
[[nodiscard]]
Q
a() const;
<mp-units/random.h>
[[nodiscard]]
Q
b() const;
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
template<Quantity Q>
requires std::integral<typename Q::rep>
struct uniform_int_distribution
: std::uniform_int_distribution<Q::rep>
| Name | Description |
|---|---|
std::uniform_int_distribution<Q::rep> |
<mp-units/random.h>
struct uniform_real_distribution
: std::uniform_real_distribution<Q::rep>
| Name | Description |
|---|---|
std::uniform_real_distribution<Q::rep> |
| Name |
|---|
base |
rep |
| Name | Description |
|---|---|
uniform_real_distribution [constructor] | Constructors |
a | |
b | |
max | |
min | |
operator() |
<mp-units/random.h>
using base = std::uniform_real_distribution<rep>;
<mp-units/random.h>
using rep = Q::rep;
Constructors
<mp-units/random.h>Default constructor
uniform_real_distribution();
» more...
uniform_real_distribution(
Q const& a,
Q const& b);
» more...
Default constructor
<mp-units/random.h>
uniform_real_distribution();
<mp-units/random.h>
uniform_real_distribution(
Q const& a,
Q const& b);
<mp-units/random.h>
[[nodiscard]]
Q
a() const;
<mp-units/random.h>
[[nodiscard]]
Q
b() const;
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
template<Quantity Q>
requires std::floating_point<typename Q::rep>
struct uniform_real_distribution
: std::uniform_real_distribution<Q::rep>
| Name | Description |
|---|---|
std::uniform_real_distribution<Q::rep> |
<mp-units/framework/unit_symbol_formatting.h>
struct unit_symbol_formatting;
| Name |
|---|
char_set |
separator |
solidus |
<mp-units/framework/unit_symbol_formatting.h>
character_set char_set = character_set::default_character_set;
<mp-units/framework/unit_symbol_formatting.h>
unit_symbol_separator separator = unit_symbol_separator::default_separator;
<mp-units/framework/unit_symbol_formatting.h>
unit_symbol_solidus solidus = unit_symbol_solidus::default_solidus;
<mp-units/random.h>
struct weibull_distribution
: std::weibull_distribution<Q::rep>
| Name | Description |
|---|---|
std::weibull_distribution<Q::rep> |
| Name |
|---|
base |
rep |
| Name | Description |
|---|---|
weibull_distribution [constructor] | Constructors |
max | |
min | |
operator() |
<mp-units/random.h>
using base = std::weibull_distribution<rep>;
<mp-units/random.h>
using rep = Q::rep;
Constructors
<mp-units/random.h>Default constructor
weibull_distribution();
» more...
weibull_distribution(
rep const& a,
rep const& b);
» more...
Default constructor
<mp-units/random.h>
weibull_distribution();
<mp-units/random.h>
[[nodiscard]]
Q
max() const;
<mp-units/random.h>
[[nodiscard]]
Q
min() const;
<mp-units/random.h>
template<typename Generator>
Q
operator()(Generator& g);
<mp-units/random.h>
template<Quantity Q>
requires std::floating_point<typename Q::rep>
struct weibull_distribution
: std::weibull_distribution<Q::rep>
| Name | Description |
|---|---|
std::weibull_distribution<Q::rep> |
<mp-units/framework/quantity_point.h>
template<QuantitySpec auto QS>
struct zeroth_point_origin_ final
: absolute_point_origin<QS>
| Name | Description |
|---|---|
absolute_point_origin<QS> |
<mp-units/framework/symbol_text.h>
enum class character_set : int8_t;
| Name |
|---|
utf8 |
unicode |
portable |
ascii |
default_character_set |
default_encoding |
Quantity character
<mp-units/framework/representation_concepts.h>
enum class quantity_character : int8_t;
| Name |
|---|
real_scalar |
complex_scalar |
vector |
tensor |
Scalars, vectors and tensors are mathematical objects that can be used to denote certain physical quantities and their values. They are as such independent of the particular choice of a coordinate system, whereas each scalar component of a vector or a tensor and each component vector and component tensor depend on that choice.
A scalar is a physical quantity that has magnitude but no direction. It might be a real or complex number which affects which operations are allowed on a quantity.
Vectors are physical quantities that possess both magnitude and direction and whose operations obey the axioms of a vector space.
Tensors can be used to describe more general physical quantities. For example, the Cauchy stress tensor possess magnitude, direction, and orientation qualities.
<mp-units/framework/unit_symbol_formatting.h>
enum class unit_symbol_separator : int8_t;
| Name |
|---|
space |
half_high_dot |
default_separator |
<mp-units/framework/unit_symbol_formatting.h>
enum class unit_symbol_solidus : int8_t;
| Name |
|---|
one_denominator |
always |
never |
default_solidus |
Computes the absolute value of a quantity
<mp-units/math.h>
template<
auto R,
typename Rep>
requires requires(Rep v) { abs(v); } || requires(Rep v) { std::abs(v); }
[[nodiscard]]
constexpr
quantity<R, Rep>
abs(quantity<R, Rep> const& q) noexcept;
| Name | Description |
|---|---|
| q | Quantity being the base of the operation |
<mp-units/framework/quantity_spec.h>
template<
QuantitySpec From,
QuantitySpec To>
[[nodiscard]]
consteval
bool
castable(
From from,
To to);
cbrt overloads
<mp-units/framework/dimension.h>Computes the cubic root of a dimension
[[nodiscard]]
consteval
QuantitySpec auto
cbrt(auto d);
» more...
[[nodiscard]]
consteval
/* implementation-defined */
cbrt(reference);
» more...
Computes the cubic root of a quantity
template<
auto R,
typename Rep>
requires requires(Rep v) { cbrt(v); } || requires(Rep v) { std::cbrt(v); }
[[nodiscard]]
constexpr
quantity<cbrt(R), Rep>
cbrt(quantity<R, Rep> const& q) noexcept;
» more...
| Name | Description |
|---|---|
| d | Dimension being the base of the operation |
| q | Quantity specification being the base of the operation |
| u | Unit being the base of the operation |
Computes the cubic root of a dimension
<mp-units/framework/dimension.h>
[[nodiscard]]
consteval
QuantitySpec auto
cbrt(auto d);
| Name | Description |
|---|---|
| d | Dimension being the base of the operation |
| q | Quantity specification being the base of the operation |
| u | Unit being the base of the operation |
<mp-units/framework/reference.h>
[[nodiscard]]
consteval
/* implementation-defined */
cbrt(reference);
Computes the cubic root of a quantity
<mp-units/math.h>
template<
auto R,
typename Rep>
requires requires(Rep v) { cbrt(v); } || requires(Rep v) { std::cbrt(v); }
[[nodiscard]]
constexpr
quantity<cbrt(R), Rep>
cbrt(quantity<R, Rep> const& q) noexcept;
Both the quantity value and its quantity specification are the base of the operation.
| Name | Description |
|---|---|
| q | Quantity being the base of the operation |
Computes the smallest quantity with integer representation and unit type To with its number not less than q
<mp-units/math.h>
template<
Unit auto To,
auto R,
typename Rep>
[[nodiscard]]
constexpr
quantity<detail::clone_reference_with<To>(R), Rep>
ceil(quantity<R, Rep> const& q) noexcept
requires requires { q.force_in(To); } &&
((treat_as_floating_point<Rep> && (requires(Rep v) { ceil(v); } || requires(Rep v) { std::ceil(v); })) ||
(!treat_as_floating_point<Rep> && requires { representation_values<Rep>::one(); }));
| Name | Description |
|---|---|
| q | Quantity being the base of the operation |
| Name | Description |
|---|---|
| q | A quantity |
<mp-units/ext/type_traits.h>
template<
typename T,
auto Vs...>
[[nodiscard]]
consteval
bool
contains();
» more...
template<
template<typename...> typename T,
typename... Ts>
[[nodiscard]]
consteval
bool
contains();
» more...
template<
template<auto...> typename T,
typename... Ts>
[[nodiscard]]
consteval
bool
contains();
» more...
<mp-units/ext/type_traits.h>
template<
typename T,
auto Vs...>
[[nodiscard]]
consteval
bool
contains();
<mp-units/ext/type_traits.h>
template<
template<typename...> typename T,
typename... Ts>
[[nodiscard]]
consteval
bool
contains();
<mp-units/ext/type_traits.h>
template<
template<auto...> typename T,
typename... Ts>
[[nodiscard]]
consteval
bool
contains();
Computes the cubic power of a unit
| Name | Description |
|---|---|
| u | Unit being the base of the operation |
<mp-units/framework/quantity_point.h>
template<Reference R>
[[nodiscard]]
consteval
PointOriginFor<get_quantity_spec(R{})> auto
default_point_origin(R);
<mp-units/framework/dimension.h>
template<
dimension_symbol_formatting fmt = dimension_symbol_formatting{},
typename CharT = char,
Dimension D>
[[nodiscard]]
consteval
std::basic_string_view<CharT>
dimension_symbol(D);
<mp-units/framework/dimension.h>
template<
typename CharT = char,
std::output_iterator<CharT> Out,
Dimension D>
constexpr
Out
dimension_symbol_to(
Out out,
D d,
dimension_symbol_formatting const& fmt = dimension_symbol_formatting{});
Returns the epsilon of the quantity
<mp-units/math.h>
template<
typename Rep,
Reference R>
requires RepresentationOf<Rep, get_quantity_spec(R{})> && requires { std::numeric_limits<Rep>::epsilon(); }
[[deprecated, nodiscard]]
constexpr
quantity<R{}, Rep>
epsilon(R r) noexcept;
The returned value is defined by a .
| Name | Description |
|---|---|
| Q | Quantity type being the base of the operation |
Computes Euler's raised to the given power
<mp-units/math.h>
template<
ReferenceOf<dimensionless> auto R,
typename Rep>
requires requires(Rep v) { exp(v); } || requires(Rep v) { std::exp(v); }
[[nodiscard]]
constexpr
quantity<R, Rep>
exp(quantity<R, Rep> const& q);
Such an operation has sense only for a dimensionless quantity.
| Name | Description |
|---|---|
| q | Quantity being the base of the operation |
<mp-units/framework/quantity_spec.h>
template<
QuantitySpec From,
QuantitySpec To>
[[nodiscard]]
consteval
bool
explicitly_convertible(
From from,
To to);
Computes the largest quantity with integer representation and unit type To with its number not greater than q
<mp-units/math.h>
template<
Unit auto To,
auto R,
typename Rep>
[[nodiscard]]
constexpr
quantity<detail::clone_reference_with<To>(R), Rep>
floor(quantity<R, Rep> const& q) noexcept
requires requires { q.force_in(To); } &&
((treat_as_floating_point<Rep> && (requires(Rep v) { floor(v); } || requires(Rep v) { std::floor(v); })) ||
(!treat_as_floating_point<Rep> && requires { representation_values<Rep>::one(); }));
| Name | Description |
|---|---|
| q | Quantity being the base of the operation |
| Name | Description |
|---|---|
| q | A quantity |
fma overloads
<mp-units/math.h>Computes the fma of 3 quantities
template<
auto R,
auto S,
auto T,
typename Rep1,
typename Rep2,
typename Rep3>
requires requires { get_common_quantity_spec(get_quantity_spec(R) * get_quantity_spec(S), get_quantity_spec(T)); } &&
(equivalent(get_unit(R) * get_unit(S), get_unit(T))) && requires(Rep1 v1, Rep2 v2, Rep3 v3) {
requires requires { fma(v1, v2, v3); } || requires { std::fma(v1, v2, v3); };
}
[[nodiscard]]
constexpr
QuantityOf<get_common_quantity_spec(get_quantity_spec(R) * get_quantity_spec(S), get_quantity_spec(T))> auto
fma(
quantity<R, Rep1> const& a,
quantity<S, Rep2> const& x,
quantity<T, Rep3> const& b) noexcept;
» more...
Computes the fma of 2 quantities and a quantity point
template<
auto R,
auto S,
auto T,
auto Origin,
typename Rep1,
typename Rep2,
typename Rep3>
requires requires { get_common_quantity_spec(get_quantity_spec(R) * get_quantity_spec(S), get_quantity_spec(T)); } &&
(equivalent(get_unit(R) * get_unit(S), get_unit(T))) && requires(Rep1 v1, Rep2 v2, Rep3 v3) {
requires requires { fma(v1, v2, v3); } || requires { std::fma(v1, v2, v3); };
}
[[nodiscard]]
constexpr
QuantityPointOf<get_common_quantity_spec(get_quantity_spec(R) * get_quantity_spec(S), get_quantity_spec(T))> auto
fma(
quantity<R, Rep1> const& a,
quantity<S, Rep2> const& x,
quantity_point<T, Origin, Rep3> const& b) noexcept;
» more...
| Name | Description |
|---|---|
| a: | Multiplicand |
| x: | Multiplicand |
| b: | Addend |
Computes the fma of 3 quantities
<mp-units/math.h>
template<
auto R,
auto S,
auto T,
typename Rep1,
typename Rep2,
typename Rep3>
requires requires { get_common_quantity_spec(get_quantity_spec(R) * get_quantity_spec(S), get_quantity_spec(T)); } &&
(equivalent(get_unit(R) * get_unit(S), get_unit(T))) && requires(Rep1 v1, Rep2 v2, Rep3 v3) {
requires requires { fma(v1, v2, v3); } || requires { std::fma(v1, v2, v3); };
}
[[nodiscard]]
constexpr
QuantityOf<get_common_quantity_spec(get_quantity_spec(R) * get_quantity_spec(S), get_quantity_spec(T))> auto
fma(
quantity<R, Rep1> const& a,
quantity<S, Rep2> const& x,
quantity<T, Rep3> const& b) noexcept;
| Name | Description |
|---|---|
| a: | Multiplicand |
| x: | Multiplicand |
| b: | Addend |
| a | A quantity |
| x | A quantity |
| b | A quantity |
Computes the fma of 2 quantities and a quantity point
<mp-units/math.h>
template<
auto R,
auto S,
auto T,
auto Origin,
typename Rep1,
typename Rep2,
typename Rep3>
requires requires { get_common_quantity_spec(get_quantity_spec(R) * get_quantity_spec(S), get_quantity_spec(T)); } &&
(equivalent(get_unit(R) * get_unit(S), get_unit(T))) && requires(Rep1 v1, Rep2 v2, Rep3 v3) {
requires requires { fma(v1, v2, v3); } || requires { std::fma(v1, v2, v3); };
}
[[nodiscard]]
constexpr
QuantityPointOf<get_common_quantity_spec(get_quantity_spec(R) * get_quantity_spec(S), get_quantity_spec(T))> auto
fma(
quantity<R, Rep1> const& a,
quantity<S, Rep2> const& x,
quantity_point<T, Origin, Rep3> const& b) noexcept;
| Name | Description |
|---|---|
| a: | Multiplicand |
| x: | Multiplicand |
| b: | Addend |
| a | A quantity |
| x | A quantity |
| b | A quantity point |
Computes the floating-point remainder of the division operation x / y.
<mp-units/math.h>
template<
auto R1,
typename Rep1,
auto R2,
typename Rep2>
requires requires(Rep1 v1, Rep2 v2) {
get_common_reference(R1, R2);
requires requires { fmod(v1, v2); } || requires { std::fmod(v1, v2); };
}
[[nodiscard]]
constexpr
QuantityOf<get_quantity_spec(R1)> auto
fmod(
quantity<R1, Rep1> const& x,
quantity<R2, Rep2> const& y) noexcept;
| Name | Description |
|---|---|
| x | A quantity |
| y | A quantity |
<mp-units/ext/type_traits.h>
template<
typename T,
same_as<T> auto V>
[[nodiscard]]
consteval
auto
get();
» more...
template<
template<typename...> typename T,
typename T1>
requires is_specialization_of<T1, T>
[[nodiscard]]
consteval
auto
get();
» more...
template<
template<auto...> typename T,
typename T1>
requires is_specialization_of_v<T1, T>
[[nodiscard]]
consteval
auto
get();
» more...
template<
typename T,
auto V1,
auto V2,
auto Vs...>
[[nodiscard]]
consteval
auto
get();
» more...
template<
template<typename...> typename T,
typename T1,
typename T2,
typename... Ts>
[[nodiscard]]
consteval
auto
get();
» more...
template<
template<auto...> typename T,
typename T1,
typename T2,
typename... Ts>
[[nodiscard]]
consteval
auto
get();
» more...
<mp-units/ext/type_traits.h>
template<
typename T,
same_as<T> auto V>
[[nodiscard]]
consteval
auto
get();
<mp-units/ext/type_traits.h>
template<
template<typename...> typename T,
typename T1>
requires is_specialization_of<T1, T>
[[nodiscard]]
consteval
auto
get();
<mp-units/ext/type_traits.h>
template<
template<auto...> typename T,
typename T1>
requires is_specialization_of_v<T1, T>
[[nodiscard]]
consteval
auto
get();
<mp-units/ext/type_traits.h>
template<
typename T,
auto V1,
auto V2,
auto Vs...>
[[nodiscard]]
consteval
auto
get();
<mp-units/ext/type_traits.h>
template<
template<typename...> typename T,
typename T1,
typename T2,
typename... Ts>
[[nodiscard]]
consteval
auto
get();
<mp-units/ext/type_traits.h>
template<
template<auto...> typename T,
typename T1,
typename T2,
typename... Ts>
[[nodiscard]]
consteval
auto
get();
<mp-units/framework/unit.h>
[[nodiscard]]
consteval
auto
get_canonical_unit(auto u);
<mp-units/framework/quantity_spec.h>
[[nodiscard]]
consteval
QuantitySpec auto
get_common_quantity_spec(auto q);
» more...
template<
QuantitySpec Q1,
QuantitySpec Q2>
requires (detail::have_common_quantity_spec(Q1{}, Q2{}))
[[nodiscard]]
consteval
QuantitySpec auto
get_common_quantity_spec(
Q1,
Q2);
» more...
[[nodiscard]]
consteval
QuantitySpec auto
get_common_quantity_spec(
auto q1,
auto q2,
auto q3,
auto... rest)
requires requires { mp_units::get_common_quantity_spec(mp_units::get_common_quantity_spec(q1, q2), q3, rest...); };
» more...
<mp-units/framework/quantity_spec.h>
[[nodiscard]]
consteval
QuantitySpec auto
get_common_quantity_spec(auto q);
<mp-units/framework/quantity_spec.h>
template<
QuantitySpec Q1,
QuantitySpec Q2>
requires (detail::have_common_quantity_spec(Q1{}, Q2{}))
[[nodiscard]]
consteval
QuantitySpec auto
get_common_quantity_spec(
Q1,
Q2);
<mp-units/framework/quantity_spec.h>
[[nodiscard]]
consteval
QuantitySpec auto
get_common_quantity_spec(
auto q1,
auto q2,
auto q3,
auto... rest)
requires requires { mp_units::get_common_quantity_spec(mp_units::get_common_quantity_spec(q1, q2), q3, rest...); };
<mp-units/framework/reference.h>
template<
Reference R1,
Reference R2,
Reference... Rest>
[[nodiscard]]
consteval
Reference auto
get_common_reference(
auto u1,
auto u2,
auto... rest)
requires (!(MP_UNITS_ASSOCIATED_UNIT_T(R1) && MP_UNITS_ASSOCIATED_UNIT_T(R2) &&
(... && MP_UNITS_ASSOCIATED_UNIT_T(Rest)))) &&
requires {
get_common_quantity_spec(get_quantity_spec(r1), get_quantity_spec(r2), get_quantity_spec(rest)...);
get_common_unit(get_unit(r1), get_unit(r2), get_unit(rest)...);
};
<mp-units/framework/unit.h>
[[nodiscard]]
consteval
Unit auto
get_common_unit(auto u);
» more...
template<
Unit... Us,
/* implementation-defined */ NewUnit>
[[nodiscard]]
consteval
Unit auto
get_common_unit(
NewUnit nu,
common_unit<Us...> cu);
» more...
template<
Unit U1,
/* implementation-defined */ U2>
[[nodiscard]]
consteval
Unit auto
get_common_unit(
U1 u1,
U2 u2);
» more...
template<
Unit... Us,
/* implementation-defined */ NewUnit>
[[nodiscard]]
consteval
Unit auto
get_common_unit(
common_unit<Us...>,
NewUnit);
» more...
template<
Unit Front,
Unit... Rest,
Unit... Us>
requires (detail::UnitConvertibleTo<common_unit<Front, Rest...>, common_unit<Us...>{}>)
[[nodiscard]]
consteval
Unit auto
get_common_unit(
common_unit<Front, Rest...>,
common_unit<Us...>);
» more...
[[nodiscard]]
consteval
Unit auto
get_common_unit(
auto u1,
auto u2,
auto u3,
auto... rest)
requires requires { get_common_unit(get_common_unit(u1, u2), u3, rest...); };
» more...
<mp-units/framework/unit.h>
[[nodiscard]]
consteval
Unit auto
get_common_unit(auto u);
<mp-units/framework/unit.h>
template<
Unit... Us,
/* implementation-defined */ NewUnit>
[[nodiscard]]
consteval
Unit auto
get_common_unit(
NewUnit nu,
common_unit<Us...> cu);
<mp-units/framework/unit.h>
template<
Unit U1,
/* implementation-defined */ U2>
[[nodiscard]]
consteval
Unit auto
get_common_unit(
U1 u1,
U2 u2);
<mp-units/framework/unit.h>
template<
Unit... Us,
/* implementation-defined */ NewUnit>
[[nodiscard]]
consteval
Unit auto
get_common_unit(
common_unit<Us...>,
NewUnit);
<mp-units/framework/unit.h>
template<
Unit Front,
Unit... Rest,
Unit... Us>
requires (detail::UnitConvertibleTo<common_unit<Front, Rest...>, common_unit<Us...>{}>)
[[nodiscard]]
consteval
Unit auto
get_common_unit(
common_unit<Front, Rest...>,
common_unit<Us...>);
<mp-units/framework/unit.h>
[[nodiscard]]
consteval
Unit auto
get_common_unit(
auto u1,
auto u2,
auto u3,
auto... rest)
requires requires { get_common_unit(get_common_unit(u1, u2), u3, rest...); };
<mp-units/framework/quantity_spec.h>
template<QuantitySpec Q>
[[nodiscard]]
consteval
/* implementation-defined */ auto
get_kind(Q);
<mp-units/framework/reference_concepts.h>
template<AssociatedUnit U>
[[nodiscard]]
consteval
QuantitySpec auto
get_quantity_spec(U);
» more...
template<
typename Q,
typename U>
[[nodiscard]]
consteval
QuantitySpec auto
get_quantity_spec(reference<Q, U>);
» more...
<mp-units/framework/reference_concepts.h>
template<AssociatedUnit U>
[[nodiscard]]
consteval
QuantitySpec auto
get_quantity_spec(U);
<mp-units/framework/reference_concepts.h>
template<
typename Q,
typename U>
[[nodiscard]]
consteval
QuantitySpec auto
get_quantity_spec(reference<Q, U>);
<mp-units/framework/reference_concepts.h>
[[nodiscard]]
consteval
Unit auto
get_unit(auto u);
» more...
template<
typename Q,
typename U>
[[nodiscard]]
consteval
Unit auto
get_unit(reference<Q, U>);
» more...
<mp-units/framework/reference_concepts.h>
[[nodiscard]]
consteval
Unit auto
get_unit(auto u);
<mp-units/framework/reference_concepts.h>
template<
typename Q,
typename U>
[[nodiscard]]
consteval
Unit auto
get_unit(reference<Q, U>);
hypot overloads
<mp-units/math.h>Computes the square root of the sum of the squares of x and y, without undue overflow or underflow at intermediate stages of the computation
template<
auto R1,
typename Rep1,
auto R2,
typename Rep2>
requires requires(Rep1 v1, Rep2 v2) {
get_common_reference(R1, R2);
requires requires { hypot(v1, v2); } || requires { std::hypot(v1, v2); };
}
[[nodiscard]]
constexpr
QuantityOf<get_quantity_spec(get_common_reference(R1, R2))> auto
hypot(
quantity<R1, Rep1> const& x,
quantity<R2, Rep2> const& y) noexcept;
» more...
Computes the square root of the sum of the squares of x, y, and z, without undue overflow or underflow at intermediate stages of the computation
template<
auto R1,
typename Rep1,
auto R2,
typename Rep2,
auto R3,
typename Rep3>
requires requires(Rep1 v1, Rep2 v2, Rep3 v3) {
get_common_reference(R1, R2, R3);
requires requires { hypot(v1, v2, v3); } || requires { std::hypot(v1, v2, v3); };
}
[[nodiscard]]
constexpr
QuantityOf<get_quantity_spec(get_common_reference(R1, R2, R3))> auto
hypot(
quantity<R1, Rep1> const& x,
quantity<R2, Rep2> const& y,
quantity<R3, Rep3> const& z) noexcept;
» more...
Computes the square root of the sum of the squares of x and y, without undue overflow or underflow at intermediate stages of the computation
<mp-units/math.h>
template<
auto R1,
typename Rep1,
auto R2,
typename Rep2>
requires requires(Rep1 v1, Rep2 v2) {
get_common_reference(R1, R2);
requires requires { hypot(v1, v2); } || requires { std::hypot(v1, v2); };
}
[[nodiscard]]
constexpr
QuantityOf<get_quantity_spec(get_common_reference(R1, R2))> auto
hypot(
quantity<R1, Rep1> const& x,
quantity<R2, Rep2> const& y) noexcept;
| Name | Description |
|---|---|
| x | A quantity |
| y | A quantity |
Computes the square root of the sum of the squares of x, y, and z, without undue overflow or underflow at intermediate stages of the computation
<mp-units/math.h>
template<
auto R1,
typename Rep1,
auto R2,
typename Rep2,
auto R3,
typename Rep3>
requires requires(Rep1 v1, Rep2 v2, Rep3 v3) {
get_common_reference(R1, R2, R3);
requires requires { hypot(v1, v2, v3); } || requires { std::hypot(v1, v2, v3); };
}
[[nodiscard]]
constexpr
QuantityOf<get_quantity_spec(get_common_reference(R1, R2, R3))> auto
hypot(
quantity<R1, Rep1> const& x,
quantity<R2, Rep2> const& y,
quantity<R3, Rep3> const& z) noexcept;
| Name | Description |
|---|---|
| x | A quantity |
| y | A quantity |
| z | A quantity |
<mp-units/framework/quantity_spec_concepts.h>
template<
QuantitySpec From,
QuantitySpec To>
[[nodiscard]]
consteval
bool
implicitly_convertible(
From from,
To to);
<mp-units/framework/quantity_spec.h>
template<
QuantitySpec QS1,
QuantitySpec QS2>
[[nodiscard]]
consteval
bool
interconvertible(
QS1 qs1,
QS2 qs2);
Computes the inverse of a quantity in a provided unit
<mp-units/math.h>
[[nodiscard]]
consteval
QuantitySpec auto
inverse(auto d);
» more...
[[nodiscard]]
consteval
/* implementation-defined */
inverse(reference);
» more...
Computes the inverse of a quantity in a provided unit
template<
Unit auto To,
auto R,
typename Rep>
[[nodiscard]]
constexpr
Quantity auto
inverse(quantity<R, Rep> const& q)
requires (!detail::scaling_overflows_non_zero_values<Rep>(one / get_unit(R), To)) && requires {
representation_values<Rep>::one();
value_cast<To>(representation_values<Rep>::one() / q);
};
» more...
<mp-units/framework/dimension.h>
[[nodiscard]]
consteval
QuantitySpec auto
inverse(auto d);
<mp-units/framework/reference.h>
[[nodiscard]]
consteval
/* implementation-defined */
inverse(reference);
Computes the inverse of a quantity in a provided unit
<mp-units/math.h>
template<
Unit auto To,
auto R,
typename Rep>
[[nodiscard]]
constexpr
Quantity auto
inverse(quantity<R, Rep> const& q)
requires (!detail::scaling_overflows_non_zero_values<Rep>(one / get_unit(R), To)) && requires {
representation_values<Rep>::one();
value_cast<To>(representation_values<Rep>::one() / q);
};
| Name | Description |
|---|---|
| q | A quantity |
<mp-units/framework/compare.h>
template<typename T>
requires requires {
{ T::zero() } -> std::equality_comparable_with<T>;
}
[[nodiscard]]
constexpr
bool
is_eq_zero(T v);
<mp-units/framework/compare.h>
template<typename T>
requires requires {
{ T::zero() } -> std::three_way_comparable_with<T>;
}
[[nodiscard]]
constexpr
bool
is_gt_zero(T v);
<mp-units/framework/compare.h>
template<typename T>
requires requires {
{ T::zero() } -> std::three_way_comparable_with<T>;
}
[[nodiscard]]
constexpr
bool
is_gteq_zero(T v);
<mp-units/framework/compare.h>
template<typename T>
requires requires {
{ T::zero() } -> std::three_way_comparable_with<T>;
}
[[nodiscard]]
constexpr
bool
is_lt_zero(T v);
<mp-units/framework/compare.h>
template<typename T>
requires requires {
{ T::zero() } -> std::three_way_comparable_with<T>;
}
[[nodiscard]]
constexpr
bool
is_lteq_zero(T v);
<mp-units/framework/compare.h>
template<typename T>
requires requires {
{ T::zero() } -> std::equality_comparable_with<T>;
}
[[nodiscard]]
constexpr
bool
is_neq_zero(T v);
isfinite overloads
<mp-units/math.h>Determines if a quantity is finite.
template<
auto R,
typename Rep>
requires requires(Rep v) { isfinite(v); } || requires(Rep v) { std::isfinite(v); }
[[nodiscard]]
constexpr
bool
isfinite(quantity<R, Rep> const& a) noexcept;
» more...
Determines if a quantity point is finite.
template<
auto R,
auto PO,
typename Rep>
requires requires(quantity<R, Rep> q) { isfinite(q); }
[[nodiscard]]
constexpr
bool
isfinite(quantity_point<R, PO, Rep> const& a) noexcept;
» more...
| Name | Description |
|---|---|
| a: | Quantity to analyze. |
Determines if a quantity is finite.
<mp-units/math.h>
template<
auto R,
typename Rep>
requires requires(Rep v) { isfinite(v); } || requires(Rep v) { std::isfinite(v); }
[[nodiscard]]
constexpr
bool
isfinite(quantity<R, Rep> const& a) noexcept;
| Name | Description |
|---|---|
| a: | Quantity to analyze. |
| a | A quantity |
Determines if a quantity point is finite.
<mp-units/math.h>
template<
auto R,
auto PO,
typename Rep>
requires requires(quantity<R, Rep> q) { isfinite(q); }
[[nodiscard]]
constexpr
bool
isfinite(quantity_point<R, PO, Rep> const& a) noexcept;
| Name | Description |
|---|---|
| a: | Quantity point to analyze. |
| a | A quantity point |
isinf overloads
<mp-units/math.h>Determines if a quantity is infinite.
template<
auto R,
typename Rep>
requires requires(Rep v) { isinf(v); } || requires(Rep v) { std::isinf(v); }
[[nodiscard]]
constexpr
bool
isinf(quantity<R, Rep> const& a) noexcept;
» more...
Determines if a quantity point is infinite.
template<
auto R,
auto PO,
typename Rep>
requires requires(quantity<R, Rep> q) { isinf(q); }
[[nodiscard]]
constexpr
bool
isinf(quantity_point<R, PO, Rep> const& a) noexcept;
» more...
| Name | Description |
|---|---|
| a: | Quantity to analyze. |
Determines if a quantity is infinite.
<mp-units/math.h>
template<
auto R,
typename Rep>
requires requires(Rep v) { isinf(v); } || requires(Rep v) { std::isinf(v); }
[[nodiscard]]
constexpr
bool
isinf(quantity<R, Rep> const& a) noexcept;
| Name | Description |
|---|---|
| a: | Quantity to analyze. |
| a | A quantity |
Determines if a quantity point is infinite.
<mp-units/math.h>
template<
auto R,
auto PO,
typename Rep>
requires requires(quantity<R, Rep> q) { isinf(q); }
[[nodiscard]]
constexpr
bool
isinf(quantity_point<R, PO, Rep> const& a) noexcept;
| Name | Description |
|---|---|
| a: | Quantity point to analyze. |
| a | A quantity point |
isnan overloads
<mp-units/math.h>Determines if a quantity is a nan.
template<
auto R,
typename Rep>
requires requires(Rep v) { isnan(v); } || requires(Rep v) { std::isnan(v); }
[[nodiscard]]
constexpr
bool
isnan(quantity<R, Rep> const& a) noexcept;
» more...
Determines if a quantity point is a nan.
template<
auto R,
auto PO,
typename Rep>
requires requires(quantity<R, Rep> q) { isnan(q); }
[[nodiscard]]
constexpr
bool
isnan(quantity_point<R, PO, Rep> const& a) noexcept;
» more...
| Name | Description |
|---|---|
| a: | Quantity to analyze. |
Determines if a quantity is a nan.
<mp-units/math.h>
template<
auto R,
typename Rep>
requires requires(Rep v) { isnan(v); } || requires(Rep v) { std::isnan(v); }
[[nodiscard]]
constexpr
bool
isnan(quantity<R, Rep> const& a) noexcept;
| Name | Description |
|---|---|
| a: | Quantity to analyze. |
| a | A quantity |
Determines if a quantity point is a nan.
<mp-units/math.h>
template<
auto R,
auto PO,
typename Rep>
requires requires(quantity<R, Rep> q) { isnan(q); }
[[nodiscard]]
constexpr
bool
isnan(quantity_point<R, PO, Rep> const& a) noexcept;
| Name | Description |
|---|---|
| a: | Quantity point to analyze. |
| a | A quantity point |
Linear interpolation or extrapolation
<mp-units/math.h>
template<
auto R1,
auto Origin,
typename Rep1,
auto R2,
typename Rep2,
typename Factor>
requires requires(Rep1 a, Rep2 b, Factor t) {
get_common_reference(R1, R2);
requires requires { lerp(a, b, t); } || requires { std::lerp(a, b, t); };
}
[[nodiscard]]
constexpr
QuantityPointOf<get_quantity_spec(get_common_reference(R1, R2))> auto
lerp(
quantity_point<R1, Origin, Rep1> const& a,
quantity_point<R2, Origin, Rep2> const& b,
Factor const& t) noexcept;
Computes the linear interpolation between a and b, if the parameter t is inside [0, 1) (the linear extrapolation otherwise), i.e. the result of a + t(b − a) with accounting for floating-point calculation imprecision.
| Name | Description |
|---|---|
| a | A quantity point |
| b | A quantity point |
<mp-units/cartesian_vector.h>
[[nodiscard]]
constexpr
T
magnitude(cartesian_vector const& vec)
requires treat_as_floating_point<T>;
Computes the midpoint of two points
<mp-units/math.h>
template<
auto R1,
auto Origin,
typename Rep1,
auto R2,
typename Rep2>
requires requires(Rep1 a, Rep2 b) {
get_common_reference(R1, R2);
requires requires { midpoint(a, b); } || requires { std::midpoint(a, b); };
}
[[nodiscard]]
constexpr
QuantityPointOf<get_quantity_spec(get_common_reference(R1, R2))> auto
midpoint(
quantity_point<R1, Origin, Rep1> const& a,
quantity_point<R2, Origin, Rep2> const& b) noexcept;
| Name | Description |
|---|---|
| a | A quantity point |
| b | A quantity point |
Modulus operators
<mp-units/framework/quantity.h>
template<
std::derived_from<quantity> Q,
RepresentationOf<quantity_spec> Value>
requires detail::DimensionlessOne<Q::reference> &&
detail::InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&>
[[nodiscard]]
constexpr
Quantity auto
operator%(
Q const& lhs,
Value const& rhs);
» more...
template<
std::derived_from<quantity> Q,
RepresentationOf<quantity_spec> Value>
requires detail::DimensionlessOne<Q::reference> &&
detail::InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&>
[[nodiscard]]
constexpr
Quantity auto
operator%(
Value const& lhs,
Q const& rhs);
» more...
template<
std::derived_from<quantity> Q,
auto R2,
typename Rep2>
requires (!treat_as_floating_point<Rep>) && (!treat_as_floating_point<Rep2>) &&
detail::CommonlyInvocableQuantities<std::modulus<>, quantity, quantity<R2, Rep2>>
[[nodiscard]]
constexpr
Quantity auto
operator%(
Q const& lhs,
quantity<R2, Rep2> const& rhs);
» more...
<mp-units/framework/quantity.h>
template<
std::derived_from<quantity> Q,
RepresentationOf<quantity_spec> Value>
requires detail::DimensionlessOne<Q::reference> &&
detail::InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&>
[[nodiscard]]
constexpr
Quantity auto
operator%(
Q const& lhs,
Value const& rhs);
<mp-units/framework/quantity.h>
template<
std::derived_from<quantity> Q,
RepresentationOf<quantity_spec> Value>
requires detail::DimensionlessOne<Q::reference> &&
detail::InvokeResultOf<quantity_spec, std::modulus<>, Rep, const Value&>
[[nodiscard]]
constexpr
Quantity auto
operator%(
Value const& lhs,
Q const& rhs);
<mp-units/framework/quantity.h>
template<
std::derived_from<quantity> Q,
auto R2,
typename Rep2>
requires (!treat_as_floating_point<Rep>) && (!treat_as_floating_point<Rep2>) &&
detail::CommonlyInvocableQuantities<std::modulus<>, quantity, quantity<R2, Rep2>>
[[nodiscard]]
constexpr
Quantity auto
operator%(
Q const& lhs,
quantity<R2, Rep2> const& rhs);
Multiplication operators
<mp-units/framework/quantity.h>
template<AssociatedUnit U1>
[[nodiscard]]
consteval
/* implementation-defined */
operator*(
U1 lhs,
reference rhs);
» more...
template<AssociatedUnit U2>
[[nodiscard]]
consteval
/* implementation-defined */
operator*(
reference lhs,
U2 rhs);
» more...
template<
Reference R,
typename Q>
requires Quantity<std::remove_cvref_t<Q>>
constexpr
auto
operator*(
R lhs,
Q&& q) = delete;
» more...
template<
Reference R,
typename Rep>
requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})>
constexpr
auto
operator*(
R lhs,
Rep&& rhs) = delete;
» more...
template<
typename Q2,
typename U2>
[[nodiscard]]
consteval
/* implementation-defined */
operator*(
reference lhs,
reference<Q2, U2> rhs);
» more...
template<
std::derived_from<quantity> Q,
typename Value>
requires (!Quantity<Value>) &&
(!Reference<Value>) && detail::InvokeResultOf<quantity_spec, std::multiplies<>, rep, const Value&>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
operator*(
Q const& q,
Value const& val);
» more...
template<
typename Value,
std::derived_from<quantity> Q>
requires (!Quantity<Value>) &&
(!Reference<Value>) && detail::InvokeResultOf<quantity_spec, std::multiplies<>, const Value&, rep>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
operator*(
Value const& val,
Q const& q);
» more...
template<
std::derived_from<quantity> Q,
auto R2,
typename Rep2>
requires detail::InvocableQuantities<std::multiplies<>, quantity, quantity<R2, Rep2>>
[[nodiscard]]
constexpr
Quantity auto
operator*(
Q const& lhs,
quantity<R2, Rep2> const& rhs);
» more...
template<
typename FwdQ,
Reference R,
Quantity Q = std::remove_cvref_t<FwdQ>>
[[nodiscard]]
constexpr
Quantity auto
operator*(
FwdQ&& q,
R rhs);
» more...
Multiplication operator
template<
typename FwdRep,
Reference R,
RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>>
requires (!detail::OffsetUnit<decltype(get_unit(R{}))>)
[[nodiscard]]
constexpr
quantity<R{}, Rep>
operator*(
FwdRep&& lhs,
R r);
» more...
template<
typename FwdRep,
Reference R,
RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>>
requires detail::OffsetUnit<decltype(get_unit(R{}))>
[[deprecated]]
constexpr
auto
operator*(
FwdRep&& lhs,
R r);
» more...
<mp-units/framework/reference.h>
template<AssociatedUnit U1>
[[nodiscard]]
consteval
/* implementation-defined */
operator*(
U1 lhs,
reference rhs);
<mp-units/framework/reference.h>
template<AssociatedUnit U2>
[[nodiscard]]
consteval
/* implementation-defined */
operator*(
reference lhs,
U2 rhs);
<mp-units/framework/reference.h>
template<
Reference R,
typename Q>
requires Quantity<std::remove_cvref_t<Q>>
constexpr
auto
operator*(
R lhs,
Q&& q) = delete;
<mp-units/framework/reference.h>
template<
Reference R,
typename Rep>
requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})>
constexpr
auto
operator*(
R lhs,
Rep&& rhs) = delete;
<mp-units/framework/reference.h>
template<
typename Q2,
typename U2>
[[nodiscard]]
consteval
/* implementation-defined */
operator*(
reference lhs,
reference<Q2, U2> rhs);
<mp-units/framework/quantity.h>
template<
std::derived_from<quantity> Q,
typename Value>
requires (!Quantity<Value>) &&
(!Reference<Value>) && detail::InvokeResultOf<quantity_spec, std::multiplies<>, rep, const Value&>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
operator*(
Q const& q,
Value const& val);
<mp-units/framework/quantity.h>
template<
typename Value,
std::derived_from<quantity> Q>
requires (!Quantity<Value>) &&
(!Reference<Value>) && detail::InvokeResultOf<quantity_spec, std::multiplies<>, const Value&, rep>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
operator*(
Value const& val,
Q const& q);
<mp-units/framework/quantity.h>
template<
std::derived_from<quantity> Q,
auto R2,
typename Rep2>
requires detail::InvocableQuantities<std::multiplies<>, quantity, quantity<R2, Rep2>>
[[nodiscard]]
constexpr
Quantity auto
operator*(
Q const& lhs,
quantity<R2, Rep2> const& rhs);
<mp-units/framework/reference.h>
template<
typename FwdQ,
Reference R,
Quantity Q = std::remove_cvref_t<FwdQ>>
[[nodiscard]]
constexpr
Quantity auto
operator*(
FwdQ&& q,
R rhs);
Multiplication operator
<mp-units/framework/reference.h>
template<
typename FwdRep,
Reference R,
RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>>
requires (!detail::OffsetUnit<decltype(get_unit(R{}))>)
[[nodiscard]]
constexpr
quantity<R{}, Rep>
operator*(
FwdRep&& lhs,
R r);
| Name | Description |
|---|---|
| lhs | The left operand |
| r | The right operand |
<mp-units/framework/reference.h>
template<
typename FwdRep,
Reference R,
RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>>
requires detail::OffsetUnit<decltype(get_unit(R{}))>
[[deprecated]]
constexpr
auto
operator*(
FwdRep&& lhs,
R r);
Addition operators
<mp-units/ext/fixed_string.h>Addition operator
[[nodiscard]]
constexpr
basic_fixed_string<CharT, 1 + N>
operator+(
CharT const lhs,
basic_fixed_string const& rhs) noexcept;
» more...
Addition operator
[[nodiscard]]
constexpr
basic_fixed_string<CharT, N + 1>
operator+(
basic_fixed_string const& lhs,
CharT rhs) noexcept;
» more...
Addition operator
template<std::size_t N2>
[[nodiscard]]
constexpr
basic_fixed_string<CharT, N + N2>
operator+(
basic_fixed_string const& lhs,
basic_fixed_string<CharT, N2> const& rhs) noexcept;
» more...
Addition operator
template<std::size_t N2>
[[nodiscard]]
consteval
basic_fixed_string<CharT, N + N2 - 1>
operator+(
basic_fixed_string const& lhs,
CharT const(& rhs)[]) noexcept;
» more...
Addition operator
template<std::size_t N1>
[[nodiscard]]
consteval
basic_fixed_string<CharT, N1 + N - 1>
operator+(
CharT const(& lhs)[],
basic_fixed_string const& rhs) noexcept;
» more...
template<
std::derived_from<quantity> Q,
RepresentationOf<quantity_spec> Value>
requires detail::DimensionlessOne<Q::reference> &&
detail::InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&>
[[nodiscard]]
constexpr
Quantity auto
operator+(
Q const& lhs,
Value const& rhs);
» more...
template<
std::derived_from<quantity> Q,
RepresentationOf<quantity_spec> Value>
requires detail::DimensionlessOne<Q::reference> &&
detail::InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&>
[[nodiscard]]
constexpr
Quantity auto
operator+(
Value const& lhs,
Q const& rhs);
» more...
Addition operator
template<
std::size_t N2,
std::size_t M2>
[[nodiscard]]
constexpr
symbol_text<N + N2, M + M2>
operator+(
symbol_text const& lhs,
symbol_text<N2, M2> const& rhs);
» more...
template<
std::derived_from<quantity> Q,
auto R2,
typename Rep2>
requires detail::CommonlyInvocableQuantities<std::plus<>, quantity, quantity<R2, Rep2>>
[[nodiscard]]
constexpr
Quantity auto
operator+(
Q const& lhs,
quantity<R2, Rep2> const& rhs);
» more...
template<
std::derived_from<quantity_point> QP,
ReferenceOf<PO._quantity_spec_> auto R2,
typename Rep2>
[[nodiscard]]
constexpr
QuantityPoint auto
operator+(
QP const& qp,
quantity<R2, Rep2> const& q)
requires requires { qp.quantity_ref_from(PO) + q; };
» more...
template<
ReferenceOf<PO._quantity_spec_> auto R1,
typename Rep1,
std::derived_from<quantity_point> QP>
[[nodiscard]]
constexpr
QuantityPoint auto
operator+(
quantity<R1, Rep1> const& q,
QP const& qp)
requires requires { q + qp.quantity_ref_from(PO); };
» more...
Addition operator
<mp-units/ext/fixed_string.h>
[[nodiscard]]
constexpr
basic_fixed_string<CharT, 1 + N>
operator+(
CharT const lhs,
basic_fixed_string const& rhs) noexcept;
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Addition operator
<mp-units/ext/fixed_string.h>
[[nodiscard]]
constexpr
basic_fixed_string<CharT, N + 1>
operator+(
basic_fixed_string const& lhs,
CharT rhs) noexcept;
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Addition operator
<mp-units/ext/fixed_string.h>
template<std::size_t N2>
[[nodiscard]]
constexpr
basic_fixed_string<CharT, N + N2>
operator+(
basic_fixed_string const& lhs,
basic_fixed_string<CharT, N2> const& rhs) noexcept;
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Addition operator
<mp-units/ext/fixed_string.h>
template<std::size_t N2>
[[nodiscard]]
consteval
basic_fixed_string<CharT, N + N2 - 1>
operator+(
basic_fixed_string const& lhs,
CharT const(& rhs)[]) noexcept;
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Addition operator
<mp-units/ext/fixed_string.h>
template<std::size_t N1>
[[nodiscard]]
consteval
basic_fixed_string<CharT, N1 + N - 1>
operator+(
CharT const(& lhs)[],
basic_fixed_string const& rhs) noexcept;
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
<mp-units/framework/quantity.h>
template<
std::derived_from<quantity> Q,
RepresentationOf<quantity_spec> Value>
requires detail::DimensionlessOne<Q::reference> &&
detail::InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&>
[[nodiscard]]
constexpr
Quantity auto
operator+(
Q const& lhs,
Value const& rhs);
<mp-units/framework/quantity.h>
template<
std::derived_from<quantity> Q,
RepresentationOf<quantity_spec> Value>
requires detail::DimensionlessOne<Q::reference> &&
detail::InvokeResultOf<quantity_spec, std::plus<>, Rep, const Value&>
[[nodiscard]]
constexpr
Quantity auto
operator+(
Value const& lhs,
Q const& rhs);
Addition operator
<mp-units/framework/symbol_text.h>
template<
std::size_t N2,
std::size_t M2>
[[nodiscard]]
constexpr
symbol_text<N + N2, M + M2>
operator+(
symbol_text const& lhs,
symbol_text<N2, M2> const& rhs);
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
<mp-units/framework/quantity.h>
template<
std::derived_from<quantity> Q,
auto R2,
typename Rep2>
requires detail::CommonlyInvocableQuantities<std::plus<>, quantity, quantity<R2, Rep2>>
[[nodiscard]]
constexpr
Quantity auto
operator+(
Q const& lhs,
quantity<R2, Rep2> const& rhs);
<mp-units/framework/quantity_point.h>
template<
std::derived_from<quantity_point> QP,
ReferenceOf<PO._quantity_spec_> auto R2,
typename Rep2>
[[nodiscard]]
constexpr
QuantityPoint auto
operator+(
QP const& qp,
quantity<R2, Rep2> const& q)
requires requires { qp.quantity_ref_from(PO) + q; };
<mp-units/framework/quantity_point.h>
template<
ReferenceOf<PO._quantity_spec_> auto R1,
typename Rep1,
std::derived_from<quantity_point> QP>
[[nodiscard]]
constexpr
QuantityPoint auto
operator+(
quantity<R1, Rep1> const& q,
QP const& qp)
requires requires { q + qp.quantity_ref_from(PO); };
Subtraction operators
<mp-units/framework/quantity.h>
template<
PointOrigin PO1,
std::derived_from<quantity_point> QP>
requires QuantityPointOf<quantity_point, PO1{}> &&
ReferenceOf<MP_UNITS_NONCONST_TYPE(reference), PO1::_quantity_spec_>
[[nodiscard]]
constexpr
Quantity auto
operator-(
PO1 po,
QP const& qp);
» more...
template<
std::derived_from<quantity> Q,
RepresentationOf<quantity_spec> Value>
requires detail::DimensionlessOne<Q::reference> &&
detail::InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&>
[[nodiscard]]
constexpr
Quantity auto
operator-(
Q const& lhs,
Value const& rhs);
» more...
template<
std::derived_from<quantity_point> QP,
QuantityPointOf<absolute_point_origin> QP2>
[[nodiscard]]
constexpr
Quantity auto
operator-(
QP const& lhs,
QP2 const& rhs)
requires requires { lhs.quantity_ref_from(point_origin) - rhs.quantity_ref_from(QP2::point_origin); };
» more...
template<
std::derived_from<quantity_point> QP,
PointOrigin PO2>
requires QuantityPointOf<quantity_point, PO2{}> &&
ReferenceOf<MP_UNITS_NONCONST_TYPE(reference), PO2::_quantity_spec_>
[[nodiscard]]
constexpr
Quantity auto
operator-(
QP const& qp,
PO2 po);
» more...
template<
std::derived_from<quantity> Q,
RepresentationOf<quantity_spec> Value>
requires detail::DimensionlessOne<Q::reference> &&
detail::InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&>
[[nodiscard]]
constexpr
Quantity auto
operator-(
Value const& lhs,
Q const& rhs);
» more...
template<
std::derived_from<quantity> Q,
auto R2,
typename Rep2>
requires detail::CommonlyInvocableQuantities<std::minus<>, quantity, quantity<R2, Rep2>>
[[nodiscard]]
constexpr
Quantity auto
operator-(
Q const& lhs,
quantity<R2, Rep2> const& rhs);
» more...
template<
std::derived_from<quantity_point> QP,
ReferenceOf<PO._quantity_spec_> auto R2,
typename Rep2>
[[nodiscard]]
constexpr
QuantityPoint auto
operator-(
QP const& qp,
quantity<R2, Rep2> const& q)
requires requires { qp.quantity_ref_from(PO) - q; };
» more...
<mp-units/framework/quantity_point.h>
template<
PointOrigin PO1,
std::derived_from<quantity_point> QP>
requires QuantityPointOf<quantity_point, PO1{}> &&
ReferenceOf<MP_UNITS_NONCONST_TYPE(reference), PO1::_quantity_spec_>
[[nodiscard]]
constexpr
Quantity auto
operator-(
PO1 po,
QP const& qp);
<mp-units/framework/quantity.h>
template<
std::derived_from<quantity> Q,
RepresentationOf<quantity_spec> Value>
requires detail::DimensionlessOne<Q::reference> &&
detail::InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&>
[[nodiscard]]
constexpr
Quantity auto
operator-(
Q const& lhs,
Value const& rhs);
<mp-units/framework/quantity_point.h>
template<
std::derived_from<quantity_point> QP,
QuantityPointOf<absolute_point_origin> QP2>
[[nodiscard]]
constexpr
Quantity auto
operator-(
QP const& lhs,
QP2 const& rhs)
requires requires { lhs.quantity_ref_from(point_origin) - rhs.quantity_ref_from(QP2::point_origin); };
<mp-units/framework/quantity_point.h>
template<
std::derived_from<quantity_point> QP,
PointOrigin PO2>
requires QuantityPointOf<quantity_point, PO2{}> &&
ReferenceOf<MP_UNITS_NONCONST_TYPE(reference), PO2::_quantity_spec_>
[[nodiscard]]
constexpr
Quantity auto
operator-(
QP const& qp,
PO2 po);
<mp-units/framework/quantity.h>
template<
std::derived_from<quantity> Q,
RepresentationOf<quantity_spec> Value>
requires detail::DimensionlessOne<Q::reference> &&
detail::InvokeResultOf<quantity_spec, std::minus<>, Rep, const Value&>
[[nodiscard]]
constexpr
Quantity auto
operator-(
Value const& lhs,
Q const& rhs);
<mp-units/framework/quantity.h>
template<
std::derived_from<quantity> Q,
auto R2,
typename Rep2>
requires detail::CommonlyInvocableQuantities<std::minus<>, quantity, quantity<R2, Rep2>>
[[nodiscard]]
constexpr
Quantity auto
operator-(
Q const& lhs,
quantity<R2, Rep2> const& rhs);
<mp-units/framework/quantity_point.h>
template<
std::derived_from<quantity_point> QP,
ReferenceOf<PO._quantity_spec_> auto R2,
typename Rep2>
[[nodiscard]]
constexpr
QuantityPoint auto
operator-(
QP const& qp,
quantity<R2, Rep2> const& q)
requires requires { qp.quantity_ref_from(PO) - q; };
Division operators
<mp-units/framework/quantity.h>
template<AssociatedUnit U1>
[[nodiscard]]
consteval
/* implementation-defined */
operator/(
U1 lhs,
reference rhs);
» more...
template<AssociatedUnit U2>
[[nodiscard]]
consteval
/* implementation-defined */
operator/(
reference lhs,
U2 rhs);
» more...
template<
Reference R,
typename Q>
requires Quantity<std::remove_cvref_t<Q>>
constexpr
auto
operator/(
R lhs,
Q&& q) = delete;
» more...
template<
Reference R,
typename Rep>
requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})>
constexpr
auto
operator/(
R lhs,
Rep&& rhs) = delete;
» more...
template<
typename Q2,
typename U2>
[[nodiscard]]
consteval
/* implementation-defined */
operator/(
reference lhs,
reference<Q2, U2> rhs);
» more...
template<
std::derived_from<quantity> Q,
typename Value>
requires (!Quantity<Value>) &&
(!Reference<Value>) && detail::InvokeResultOf<quantity_spec, std::divides<>, rep, const Value&>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
operator/(
Q const& q,
Value const& val);
» more...
template<
typename Value,
std::derived_from<quantity> Q>
requires (!Quantity<Value>) &&
(!Reference<Value>) && detail::InvokeResultOf<quantity_spec, std::divides<>, const Value&, rep>
[[nodiscard]]
constexpr
Quantity auto
operator/(
Value const& val,
Q const& q);
» more...
template<
std::derived_from<quantity> Q,
auto R2,
typename Rep2>
requires detail::InvocableQuantities<std::divides<>, quantity, quantity<R2, Rep2>>
[[nodiscard]]
constexpr
Quantity auto
operator/(
Q const& lhs,
quantity<R2, Rep2> const& rhs);
» more...
template<
typename FwdQ,
Reference R,
Quantity Q = std::remove_cvref_t<FwdQ>>
[[nodiscard]]
constexpr
Quantity auto
operator/(
FwdQ&& q,
R rhs);
» more...
template<
typename FwdRep,
Reference R,
RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>>
requires (!detail::OffsetUnit<decltype(get_unit(R{}))>)
[[nodiscard]]
constexpr
Quantity auto
operator/(
FwdRep&& lhs,
R rhs);
» more...
template<
typename FwdRep,
Reference R,
RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>>
requires detail::OffsetUnit<decltype(get_unit(R{}))>
[[deprecated]]
constexpr
auto
operator/(
FwdRep&& lhs,
R rhs);
» more...
<mp-units/framework/reference.h>
template<AssociatedUnit U1>
[[nodiscard]]
consteval
/* implementation-defined */
operator/(
U1 lhs,
reference rhs);
<mp-units/framework/reference.h>
template<AssociatedUnit U2>
[[nodiscard]]
consteval
/* implementation-defined */
operator/(
reference lhs,
U2 rhs);
<mp-units/framework/reference.h>
template<
Reference R,
typename Q>
requires Quantity<std::remove_cvref_t<Q>>
constexpr
auto
operator/(
R lhs,
Q&& q) = delete;
<mp-units/framework/reference.h>
template<
Reference R,
typename Rep>
requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{})>
constexpr
auto
operator/(
R lhs,
Rep&& rhs) = delete;
<mp-units/framework/reference.h>
template<
typename Q2,
typename U2>
[[nodiscard]]
consteval
/* implementation-defined */
operator/(
reference lhs,
reference<Q2, U2> rhs);
<mp-units/framework/quantity.h>
template<
std::derived_from<quantity> Q,
typename Value>
requires (!Quantity<Value>) &&
(!Reference<Value>) && detail::InvokeResultOf<quantity_spec, std::divides<>, rep, const Value&>
[[nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
operator/(
Q const& q,
Value const& val);
<mp-units/framework/quantity.h>
template<
typename Value,
std::derived_from<quantity> Q>
requires (!Quantity<Value>) &&
(!Reference<Value>) && detail::InvokeResultOf<quantity_spec, std::divides<>, const Value&, rep>
[[nodiscard]]
constexpr
Quantity auto
operator/(
Value const& val,
Q const& q);
<mp-units/framework/quantity.h>
template<
std::derived_from<quantity> Q,
auto R2,
typename Rep2>
requires detail::InvocableQuantities<std::divides<>, quantity, quantity<R2, Rep2>>
[[nodiscard]]
constexpr
Quantity auto
operator/(
Q const& lhs,
quantity<R2, Rep2> const& rhs);
<mp-units/framework/reference.h>
template<
typename FwdQ,
Reference R,
Quantity Q = std::remove_cvref_t<FwdQ>>
[[nodiscard]]
constexpr
Quantity auto
operator/(
FwdQ&& q,
R rhs);
<mp-units/framework/reference.h>
template<
typename FwdRep,
Reference R,
RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>>
requires (!detail::OffsetUnit<decltype(get_unit(R{}))>)
[[nodiscard]]
constexpr
Quantity auto
operator/(
FwdRep&& lhs,
R rhs);
<mp-units/framework/reference.h>
template<
typename FwdRep,
Reference R,
RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>>
requires detail::OffsetUnit<decltype(get_unit(R{}))>
[[deprecated]]
constexpr
auto
operator/(
FwdRep&& lhs,
R rhs);
pow overloads
<mp-units/framework/dimension.h>Computes the value of a reference raised to the Num/Den power
template<
intmax_t Num,
intmax_t Den = 1>
requires (Den != 0)
[[nodiscard]]
consteval
/* implementation-defined */
pow(reference);
» more...
Computes the value of a dimension raised to the Num/Den power
template<
intmax_t Num,
intmax_t Den = 1,
Unit D>
requires (Den != 0)
[[nodiscard]]
consteval
QuantitySpec auto
pow(D d);
» more...
Computes the value of a quantity raised to the Num/Den power
template<
intmax_t Num,
intmax_t Den = 1,
auto R,
typename Rep>
requires (Den != 0) && requires(Rep v) {
representation_values<Rep>::one();
requires requires { pow(v, 1.0); } || requires { std::pow(v, 1.0); };
}
[[nodiscard]]
constexpr
quantity<pow<Num, Den>(R), Rep>
pow(quantity<R, Rep> const& q) noexcept;
» more...
| Name | Description |
|---|---|
| Num | Exponent numerator |
| Den | Exponent denominator |
| Name | Description |
|---|---|
| r | Reference being the base of the operation |
| d | Dimension being the base of the operation |
| q | Quantity specification being the base of the operation |
| u | Unit being the base of the operation |
Computes the value of a reference raised to the Num/Den power
<mp-units/framework/reference.h>
template<
intmax_t Num,
intmax_t Den = 1>
requires (Den != 0)
[[nodiscard]]
consteval
/* implementation-defined */
pow(reference);
| Name | Description |
|---|---|
| Num | Exponent numerator |
| Den | Exponent denominator |
| Name | Description |
|---|---|
| r | Reference being the base of the operation |
Computes the value of a dimension raised to the Num/Den power
<mp-units/framework/dimension.h>
template<
intmax_t Num,
intmax_t Den = 1,
Unit D>
requires (Den != 0)
[[nodiscard]]
consteval
QuantitySpec auto
pow(D d);
| Name | Description |
|---|---|
| Num | Exponent numerator |
| Den | Exponent denominator |
| Name | Description |
|---|---|
| d | Dimension being the base of the operation |
| q | Quantity specification being the base of the operation |
| u | Unit being the base of the operation |
Computes the value of a quantity raised to the Num/Den power
<mp-units/math.h>
template<
intmax_t Num,
intmax_t Den = 1,
auto R,
typename Rep>
requires (Den != 0) && requires(Rep v) {
representation_values<Rep>::one();
requires requires { pow(v, 1.0); } || requires { std::pow(v, 1.0); };
}
[[nodiscard]]
constexpr
quantity<pow<Num, Den>(R), Rep>
pow(quantity<R, Rep> const& q) noexcept;
Both the quantity value and its quantity specification are the base of the operation.
| Name | Description |
|---|---|
| Num | Exponent numerator |
| Den | Exponent denominator |
| Name | Description |
|---|---|
| q | Quantity being the base of the operation |
quantity_cast overloads
<mp-units/framework/quantity_cast.h>Explicit cast of a quantity type
template<
QuantitySpec auto ToQS,
typename FwdQ,
Quantity Q = std::remove_cvref_t<FwdQ>>
requires (castable(Q::quantity_spec, ToQS)) && (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_NONCONST_TYPE(Q::unit), ToQS))
[[nodiscard]]
constexpr
Quantity auto
quantity_cast(FwdQ&& q);
» more...
Explicit cast of a quantity point type
template<
QuantitySpec auto ToQS,
typename FwdQP,
QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires (castable(QP::quantity_spec, ToQS)) && (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_NONCONST_TYPE(QP::unit), ToQS))
[[nodiscard]]
constexpr
QuantityPoint auto
quantity_cast(FwdQP&& qp);
» more...
| Name | Description |
|---|---|
| ToQS | a quantity specification to use for a target quantity |
Explicit cast of a quantity type
<mp-units/framework/quantity_cast.h>
template<
QuantitySpec auto ToQS,
typename FwdQ,
Quantity Q = std::remove_cvref_t<FwdQ>>
requires (castable(Q::quantity_spec, ToQS)) && (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_NONCONST_TYPE(Q::unit), ToQS))
[[nodiscard]]
constexpr
Quantity auto
quantity_cast(FwdQ&& q);
This cast converts only a quantity type. It might be used to force some quantity type conversions that are not implicitly allowed but are allowed explicitly.
For example:
{.cpp}
auto length = isq::length(42 * m);
auto distance = quantity_cast<isq::distance>(length);
This cast does not affect the underlying value of a number stored in a quantity.
| Name | Description |
|---|---|
| ToQS | a quantity specification to use for a target quantity |
Explicit cast of a quantity point type
<mp-units/framework/quantity_cast.h>
template<
QuantitySpec auto ToQS,
typename FwdQP,
QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires (castable(QP::quantity_spec, ToQS)) && (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_NONCONST_TYPE(QP::unit), ToQS))
[[nodiscard]]
constexpr
QuantityPoint auto
quantity_cast(FwdQP&& qp);
This cast converts only a quantity point type. It might be used to force some quantity point type conversions that are not implicitly allowed but are allowed explicitly.
For example:
{.cpp}
auto length = isq::length(quantity_point{42 * m});
auto altitude = quantity_cast<isq::altitude>(length);
This cast does not affect the underlying value of a number stored in a quantity point.
| Name | Description |
|---|---|
| ToQS | a quantity specification to use for a target quantity point |
Computes the IEEE remainder of the floating point division operation x / y.
<mp-units/math.h>
template<
auto R1,
typename Rep1,
auto R2,
typename Rep2>
requires requires(Rep1 v1, Rep2 v2) {
get_common_reference(R1, R2);
requires requires { remainder(v1, v2); } || requires { std::remainder(v1, v2); };
}
[[nodiscard]]
constexpr
QuantityOf<get_quantity_spec(R1)> auto
remainder(
quantity<R1, Rep1> const& x,
quantity<R2, Rep2> const& y) noexcept;
| Name | Description |
|---|---|
| x | A quantity |
| y | A quantity |
Computes the nearest quantity with integer representation and unit type To to q
<mp-units/math.h>
template<
Unit auto To,
auto R,
typename Rep>
[[nodiscard]]
constexpr
quantity<detail::clone_reference_with<To>(R), Rep>
round(quantity<R, Rep> const& q) noexcept
requires requires {
mp_units::floor<To>(q);
representation_values<Rep>::one();
} && std::constructible_from<std::int64_t, Rep>;
Returns the value res representable in To unit that is the closest to q. If there are two such values, returns the even value (that is, the value res such that res % 2 == 0).
To, rounding to even in halfway cases.
| Name | Description |
|---|---|
| q | Quantity being the base of the operation |
| Name | Description |
|---|---|
| q | A quantity |
sqrt overloads
<mp-units/framework/dimension.h>Computes the square root of a dimension
[[nodiscard]]
consteval
QuantitySpec auto
sqrt(auto d);
» more...
[[nodiscard]]
consteval
/* implementation-defined */
sqrt(reference);
» more...
Computes the square root of a quantity
template<
auto R,
typename Rep>
requires requires(Rep v) { sqrt(v); } || requires(Rep v) { std::sqrt(v); }
[[nodiscard]]
constexpr
quantity<sqrt(R), Rep>
sqrt(quantity<R, Rep> const& q) noexcept;
» more...
| Name | Description |
|---|---|
| d | Dimension being the base of the operation |
| q | Quantity specification being the base of the operation |
| u | Unit being the base of the operation |
Computes the square root of a dimension
<mp-units/framework/dimension.h>
[[nodiscard]]
consteval
QuantitySpec auto
sqrt(auto d);
| Name | Description |
|---|---|
| d | Dimension being the base of the operation |
| q | Quantity specification being the base of the operation |
| u | Unit being the base of the operation |
<mp-units/framework/reference.h>
[[nodiscard]]
consteval
/* implementation-defined */
sqrt(reference);
Computes the square root of a quantity
<mp-units/math.h>
template<
auto R,
typename Rep>
requires requires(Rep v) { sqrt(v); } || requires(Rep v) { std::sqrt(v); }
[[nodiscard]]
constexpr
quantity<sqrt(R), Rep>
sqrt(quantity<R, Rep> const& q) noexcept;
Both the quantity value and its quantity specification are the base of the operation.
| Name | Description |
|---|---|
| q | Quantity being the base of the operation |
Computes the square power of a unit
| Name | Description |
|---|---|
| u | Unit being the base of the operation |
<mp-units/ext/fixed_string.h>
template<
class CharT,
std::size_t N>
constexpr
void
swap(
basic_fixed_string<CharT, N>& x,
basic_fixed_string<CharT, N>& y) noexcept;
<mp-units/framework/unit.h>
template<
unit_symbol_formatting fmt = unit_symbol_formatting{},
typename CharT = char,
Unit U>
[[nodiscard]]
consteval
std::basic_string_view<CharT>
unit_symbol(U);
<mp-units/framework/unit.h>
template<
typename CharT = char,
std::output_iterator<CharT> Out,
Unit U>
constexpr
Out
unit_symbol_to(
Out out,
U u,
unit_symbol_formatting const& fmt = unit_symbol_formatting{});
<mp-units/cartesian_vector.h>
[[nodiscard]]
constexpr
cartesian_vector
unit_vector(cartesian_vector const& vec)
requires treat_as_floating_point<T>;
value_cast overloads
<mp-units/framework/value_cast.h>Explicit cast of a quantity's representation
template<
Quantity ToQ,
typename FwdQ,
Quantity Q = std::remove_cvref_t<FwdQ>>
requires (ToQ::quantity_spec == Q::quantity_spec) &&
(MP_UNITS_WEAK_UNIT_OF(MP_UNITS_NONCONST_TYPE(ToQ::unit), Q::quantity_spec)) &&
std::constructible_from<typename ToQ::rep, typename Q::rep> &&
detail::SaneScaling<Q::unit, ToQ::unit, typename ToQ::rep>
[[nodiscard]]
constexpr
Quantity auto
value_cast(FwdQ&& q);
» more...
Explicit cast of a quantity's representation type
template<
typename ToRep,
typename FwdQ,
Quantity Q = std::remove_cvref_t<FwdQ>>
requires RepresentationOf<ToRep, Q::quantity_spec> && std::constructible_from<ToRep, typename Q::rep>
[[nodiscard]]
constexpr
quantity<Q::reference, ToRep>
value_cast(FwdQ&& q);
» more...
Explicit cast of a quantity's unit
template<
auto ToU,
typename FwdQ,
Quantity Q = std::remove_cvref_t<FwdQ>>
requires (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_REMOVE_CONST(decltype(ToU)), Q::quantity_spec)) &&
detail::SaneScaling<Q::unit, ToU, typename Q::rep>
[[nodiscard]]
constexpr
Quantity auto
value_cast(FwdQ&& q);
» more...
Explicit cast of a quantity point's representation
template<
Quantity ToQ,
typename FwdQP,
QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires (ToQ::quantity_spec == QP::quantity_spec) &&
(MP_UNITS_WEAK_UNIT_OF(MP_UNITS_NONCONST_TYPE(ToQ::unit), QP::quantity_spec)) &&
std::constructible_from<typename ToQ::rep, typename QP::rep> &&
detail::SaneScaling<QP::unit, ToQ::unit, typename ToQ::rep>
[[nodiscard]]
constexpr
QuantityPoint auto
value_cast(FwdQP&& qp);
» more...
Explicit cast of a quantity point's representation, including potentially the point origin
template<
QuantityPoint ToQP,
typename FwdQP,
QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires (ToQP::quantity_spec == QP::quantity_spec) &&
(MP_UNITS_WEAK_UNIT_OF(MP_UNITS_NONCONST_TYPE(ToQP::unit), QP::quantity_spec)) &&
(detail::same_absolute_point_origins(ToQP::point_origin, QP::point_origin)) &&
std::constructible_from<typename ToQP::rep, typename QP::rep> &&
detail::SaneScaling<QP::unit, ToQP::unit, typename ToQP::rep>
[[nodiscard]]
constexpr
QuantityPoint auto
value_cast(FwdQP&& qp);
» more...
Explicit cast of a quantity point's representation type
template<
typename ToRep,
typename FwdQP,
QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires RepresentationOf<ToRep, QP::quantity_spec> && std::constructible_from<ToRep, typename QP::rep>
[[nodiscard]]
constexpr
quantity_point<QP::reference, QP::point_origin, ToRep>
value_cast(FwdQP&& qp);
» more...
Explicit cast of a quantity point's unit
template<
Unit auto ToU,
typename FwdQP,
QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_REMOVE_CONST(decltype(ToU)), QP::quantity_spec)) &&
detail::SaneScaling<QP::unit, ToU, typename QP::rep>
[[nodiscard]]
constexpr
QuantityPoint auto
value_cast(FwdQP&& qp);
» more...
template<
typename ToRep,
Unit auto ToU,
typename FwdQ,
Quantity Q = std::remove_cvref_t<FwdQ>>
requires (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_REMOVE_CONST(decltype(ToU)), Q::quantity_spec)) &&
RepresentationOf<ToRep, Q::quantity_spec> && std::constructible_from<ToRep, typename Q::rep> &&
detail::SaneScaling<Q::unit, ToU, ToRep>
[[nodiscard]]
constexpr
Quantity auto
value_cast(FwdQ&& q);
» more...
Explicit cast of a quantity's unit and representation type
template<
Unit auto ToU,
typename ToRep,
typename FwdQ,
Quantity Q = std::remove_cvref_t<FwdQ>>
requires (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_REMOVE_CONST(decltype(ToU)), Q::quantity_spec)) &&
RepresentationOf<ToRep, Q::quantity_spec> && std::constructible_from<ToRep, typename Q::rep> &&
detail::SaneScaling<Q::unit, ToU, ToRep>
[[nodiscard]]
constexpr
Quantity auto
value_cast(FwdQ&& q);
» more...
template<
typename ToRep,
Unit auto ToU,
typename FwdQP,
QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_REMOVE_CONST(decltype(ToU)), QP::quantity_spec)) &&
RepresentationOf<ToRep, QP::quantity_spec> && std::constructible_from<ToRep, typename QP::rep> &&
detail::SaneScaling<QP::unit, ToU, ToRep>
[[nodiscard]]
constexpr
QuantityPoint auto
value_cast(FwdQP&& qp);
» more...
Explicit cast of a quantity point's unit and representation type
template<
Unit auto ToU,
typename ToRep,
typename FwdQP,
QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_REMOVE_CONST(decltype(ToU)), QP::quantity_spec)) &&
RepresentationOf<ToRep, QP::quantity_spec> && std::constructible_from<ToRep, typename QP::rep> &&
detail::SaneScaling<QP::unit, ToU, ToRep>
[[nodiscard]]
constexpr
QuantityPoint auto
value_cast(FwdQP&& qp);
» more...
| Name | Description |
|---|---|
| ToQ | a target quantity type to which to cast the representation |
| ToRep | a representation type to use for a target quantity |
| ToU | a unit to use for a target quantity |
| ToQP | a target quantity point type to which to cast the representation of the point |
Explicit cast of a quantity's representation
<mp-units/framework/value_cast.h>
template<
Quantity ToQ,
typename FwdQ,
Quantity Q = std::remove_cvref_t<FwdQ>>
requires (ToQ::quantity_spec == Q::quantity_spec) &&
(MP_UNITS_WEAK_UNIT_OF(MP_UNITS_NONCONST_TYPE(ToQ::unit), Q::quantity_spec)) &&
std::constructible_from<typename ToQ::rep, typename Q::rep> &&
detail::SaneScaling<Q::unit, ToQ::unit, typename ToQ::rep>
[[nodiscard]]
constexpr
Quantity auto
value_cast(FwdQ&& q);
Implicit conversions between quantities of different types are allowed only for "safe" (e.g. non-truncating) conversion. In truncating cases an explicit cast have to be used.
using ToQ = quantity<us, int>; auto q = value_cast<ToQ>(1.23 * ms);
Note that value_cast only changes the "representation aspects" (unit and representation type), but not the "meaning" (quantity type).
| Name | Description |
|---|---|
| ToQ | a target quantity type to which to cast the representation |
Explicit cast of a quantity's representation type
<mp-units/framework/value_cast.h>
template<
typename ToRep,
typename FwdQ,
Quantity Q = std::remove_cvref_t<FwdQ>>
requires RepresentationOf<ToRep, Q::quantity_spec> && std::constructible_from<ToRep, typename Q::rep>
[[nodiscard]]
constexpr
quantity<Q::reference, ToRep>
value_cast(FwdQ&& q);
Implicit conversions between quantities of different types are allowed only for "safe" (e.g. non-truncating) conversion. In truncating cases an explicit cast have to be used.
auto q = value_cast<int>(1.23 * ms);
| Name | Description |
|---|---|
| ToRep | a representation type to use for a target quantity |
Explicit cast of a quantity's unit
<mp-units/framework/value_cast.h>
template<
auto ToU,
typename FwdQ,
Quantity Q = std::remove_cvref_t<FwdQ>>
requires (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_REMOVE_CONST(decltype(ToU)), Q::quantity_spec)) &&
detail::SaneScaling<Q::unit, ToU, typename Q::rep>
[[nodiscard]]
constexpr
Quantity auto
value_cast(FwdQ&& q);
Implicit conversions between quantities of different types are allowed only for "safe" (e.g. non-truncating) conversion. In truncating cases an explicit cast have to be used.
auto d = value_cast<si::second>(1234 * ms);
| Name | Description |
|---|---|
| ToU | a unit to use for a target quantity |
Explicit cast of a quantity point's representation
<mp-units/framework/value_cast.h>
template<
Quantity ToQ,
typename FwdQP,
QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires (ToQ::quantity_spec == QP::quantity_spec) &&
(MP_UNITS_WEAK_UNIT_OF(MP_UNITS_NONCONST_TYPE(ToQ::unit), QP::quantity_spec)) &&
std::constructible_from<typename ToQ::rep, typename QP::rep> &&
detail::SaneScaling<QP::unit, ToQ::unit, typename ToQ::rep>
[[nodiscard]]
constexpr
QuantityPoint auto
value_cast(FwdQP&& qp);
Implicit conversions between quantities of different types are allowed only for "safe" (e.g. non-truncating) conversion. In truncating cases an explicit cast have to be used.
inline constexpr struct A : absolute_point_origin A;
using ToQ = quantity<mm, int>; auto qp = value_cast<ToQ>(quantity_point{1.23 * m});
Note that value_cast only changes the "representation aspects" (unit and representation type), but not the "meaning" (quantity type or the actual point that is being described).
| Name | Description |
|---|---|
| ToQ | a target quantity type to which to cast the representation of the point |
Explicit cast of a quantity point's representation, including potentially the point origin
<mp-units/framework/value_cast.h>
template<
QuantityPoint ToQP,
typename FwdQP,
QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires (ToQP::quantity_spec == QP::quantity_spec) &&
(MP_UNITS_WEAK_UNIT_OF(MP_UNITS_NONCONST_TYPE(ToQP::unit), QP::quantity_spec)) &&
(detail::same_absolute_point_origins(ToQP::point_origin, QP::point_origin)) &&
std::constructible_from<typename ToQP::rep, typename QP::rep> &&
detail::SaneScaling<QP::unit, ToQP::unit, typename ToQP::rep>
[[nodiscard]]
constexpr
QuantityPoint auto
value_cast(FwdQP&& qp);
Implicit conversions between quantities of different types are allowed only for "safe" (e.g. non-truncating) conversion. In truncating cases an explicit cast have to be used.
inline constexpr struct A : absolute_point_origin A; inline constexpr struct B : relative_point_origin B;
using ToQP = quantity_point<mm, B, int>; auto qp = value_cast<ToQP>(quantity_point{1.23 * m});
Note that value_cast only changes the "representation aspects" (unit, representation type and point origin), but not the "meaning" (quantity type or the actual point that is being described).
Note also that changing the point origin bears risks regarding truncation and overflow similar to other casts that change representation (which is why we require a value_cast and disallow implicit conversions). This cast is guaranteed not to cause overflow of any intermediate representation type provided that the input quantity point is within the range of ToQP. Calling value_cast<ToQP>(qp) on a qp outside of the range of ToQP is potentially undefined behaviour. The implementation further attempts not to cause more than rounding error than approximately the sum of the resolution of qp as represented in FromQP, plust the resolution of qp as represented in ToQP.
| Name | Description |
|---|---|
| ToQP | a target quantity point type to which to cast the representation of the point |
Explicit cast of a quantity point's representation type
<mp-units/framework/value_cast.h>
template<
typename ToRep,
typename FwdQP,
QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires RepresentationOf<ToRep, QP::quantity_spec> && std::constructible_from<ToRep, typename QP::rep>
[[nodiscard]]
constexpr
quantity_point<QP::reference, QP::point_origin, ToRep>
value_cast(FwdQP&& qp);
Implicit conversions between quantity points of different types are allowed only for "safe" (e.g. non-truncating) conversion. In truncating cases an explicit cast have to be used.
auto qp = value_cast<int>(quantity_point{1.23 * ms});
| Name | Description |
|---|---|
| ToRep | a representation type to use for a target quantity point |
Explicit cast of a quantity point's unit
<mp-units/framework/value_cast.h>
template<
Unit auto ToU,
typename FwdQP,
QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_REMOVE_CONST(decltype(ToU)), QP::quantity_spec)) &&
detail::SaneScaling<QP::unit, ToU, typename QP::rep>
[[nodiscard]]
constexpr
QuantityPoint auto
value_cast(FwdQP&& qp);
Implicit conversions between quantity points of different types are allowed only for "safe" (e.g. non-truncating) conversion. In truncating cases an explicit cast have to be used.
auto qp = value_cast<si::second>(quantity_point{1234 * ms});
| Name | Description |
|---|---|
| ToU | a unit to use for a target quantity point |
<mp-units/framework/value_cast.h>
template<
typename ToRep,
Unit auto ToU,
typename FwdQ,
Quantity Q = std::remove_cvref_t<FwdQ>>
requires (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_REMOVE_CONST(decltype(ToU)), Q::quantity_spec)) &&
RepresentationOf<ToRep, Q::quantity_spec> && std::constructible_from<ToRep, typename Q::rep> &&
detail::SaneScaling<Q::unit, ToU, ToRep>
[[nodiscard]]
constexpr
Quantity auto
value_cast(FwdQ&& q);
Explicit cast of a quantity's unit and representation type
<mp-units/framework/value_cast.h>
template<
Unit auto ToU,
typename ToRep,
typename FwdQ,
Quantity Q = std::remove_cvref_t<FwdQ>>
requires (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_REMOVE_CONST(decltype(ToU)), Q::quantity_spec)) &&
RepresentationOf<ToRep, Q::quantity_spec> && std::constructible_from<ToRep, typename Q::rep> &&
detail::SaneScaling<Q::unit, ToU, ToRep>
[[nodiscard]]
constexpr
Quantity auto
value_cast(FwdQ&& q);
Implicit conversions between quantities of different types are allowed only for "safe" (e.g. non-truncating) conversion. In truncating cases an explicit cast have to be used.
auto q = value_cast<us, int>(1.23 * ms);
| Name | Description |
|---|---|
| ToU | a unit to use for the target quantity |
| ToRep | a representation type to use for the target quantity |
<mp-units/framework/value_cast.h>
template<
typename ToRep,
Unit auto ToU,
typename FwdQP,
QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_REMOVE_CONST(decltype(ToU)), QP::quantity_spec)) &&
RepresentationOf<ToRep, QP::quantity_spec> && std::constructible_from<ToRep, typename QP::rep> &&
detail::SaneScaling<QP::unit, ToU, ToRep>
[[nodiscard]]
constexpr
QuantityPoint auto
value_cast(FwdQP&& qp);
Explicit cast of a quantity point's unit and representation type
<mp-units/framework/value_cast.h>
template<
Unit auto ToU,
typename ToRep,
typename FwdQP,
QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_REMOVE_CONST(decltype(ToU)), QP::quantity_spec)) &&
RepresentationOf<ToRep, QP::quantity_spec> && std::constructible_from<ToRep, typename QP::rep> &&
detail::SaneScaling<QP::unit, ToU, ToRep>
[[nodiscard]]
constexpr
QuantityPoint auto
value_cast(FwdQP&& qp);
Implicit conversions between quantities of different types are allowed only for "safe" (e.g. non-truncating) conversion. In truncating cases an explicit cast have to be used.
auto qp = value_cast<us, int>(quantity_point{1.23 * ms});
| Name | Description |
|---|---|
| ToU | a unit to use for the target quantity |
| ToRep | a representation type to use for the target quantity |
Stream insertion operators
<mp-units/cartesian_vector.h>Stream insertion operator
std::basic_ostream<CharT>&
operator<<(
std::basic_ostream<CharT>& os,
basic_fixed_string const& str);
» more...
Stream insertion operator
constexpr
std::ostream&
operator<<(
std::ostream& os,
cartesian_vector const& vec);
» more...
Stream insertion operator
template<
typename CharT,
typename Traits,
Unit D>
std::basic_ostream<CharT, Traits>&
operator<<(
std::basic_ostream<CharT, Traits>& os,
D d);
» more...
Stream insertion operator
template<
typename CharT,
typename Traits,
auto R,
typename Rep>
std::basic_ostream<CharT, Traits>&
operator<<(
std::basic_ostream<CharT, Traits>& os,
quantity<R, Rep> const& q)
requires requires { os << q.numerical_value_ref_in(q.unit); };
» more...
Stream insertion operator
<mp-units/ext/fixed_string.h>
std::basic_ostream<CharT>&
operator<<(
std::basic_ostream<CharT>& os,
basic_fixed_string const& str);
| Name | Description |
|---|---|
| os | An output stream |
| str | The object to output |
Stream insertion operator
<mp-units/cartesian_vector.h>
constexpr
std::ostream&
operator<<(
std::ostream& os,
cartesian_vector const& vec);
| Name | Description |
|---|---|
| os | An output stream |
| vec | The object to output |
Stream insertion operator
<mp-units/framework/dimension.h>
template<
typename CharT,
typename Traits,
Unit D>
std::basic_ostream<CharT, Traits>&
operator<<(
std::basic_ostream<CharT, Traits>& os,
D d);
| Name | Description |
|---|---|
| os | An output stream |
| d | The object to output |
Stream insertion operator
<mp-units/framework/quantity.h>
template<
typename CharT,
typename Traits,
auto R,
typename Rep>
std::basic_ostream<CharT, Traits>&
operator<<(
std::basic_ostream<CharT, Traits>& os,
quantity<R, Rep> const& q)
requires requires { os << q.numerical_value_ref_in(q.unit); };
| Name | Description |
|---|---|
| os | An output stream |
| q | The object to output |
Equality operators
<mp-units/ext/fixed_string.h>Equality operator
template<std::size_t N2>
[[nodiscard]]
consteval
bool
operator==(
basic_fixed_string const& lhs,
CharT const(& rhs)[]);
» more...
Equality operator
template<std::size_t N2>
[[nodiscard]]
constexpr
bool
operator==(
basic_fixed_string const& lhs,
basic_fixed_string<CharT, N2> const& rhs);
» more...
Equality operator
template<
std::size_t N2,
std::size_t M2>
[[nodiscard]]
constexpr
bool
operator==(
symbol_text const& lhs,
symbol_text<N2, M2> const& rhs) noexcept;
» more...
Equality operator
template<AssociatedUnit U2>
[[nodiscard]]
consteval
bool
operator==(
reference lhs,
U2 u2);
» more...
Equality operator
template<
typename Q2,
typename U2>
[[nodiscard]]
consteval
bool
operator==(
reference lhs,
reference<Q2, U2> rhs);
» more...
Equality operator
template<
std::derived_from<quantity> Q,
RepresentationOf<quantity_spec> Value>
requires detail::DimensionlessOne<Q::reference> && std::equality_comparable_with<rep, Value>
[[nodiscard]]
constexpr
bool
operator==(
Q const& lhs,
Value const& rhs);
» more...
Equality operator
template<
std::derived_from<quantity> Q,
auto R2,
typename Rep2>
requires requires { typename std::common_type_t<quantity, quantity<R2, Rep2>>; } &&
std::equality_comparable<typename std::common_type_t<quantity, quantity<R2, Rep2>>::rep>
[[nodiscard]]
constexpr
bool
operator==(
Q const& lhs,
quantity<R2, Rep2> const& rhs);
» more...
Equality operator
template<
std::derived_from<quantity_point> QP,
QuantityPointOf<absolute_point_origin> QP2>
requires std::equality_comparable_with<quantity_type, typename QP2::quantity_type>
[[nodiscard]]
constexpr
bool
operator==(
QP const& lhs,
QP2 const& rhs);
» more...
Equality operator
<mp-units/ext/fixed_string.h>
template<std::size_t N2>
[[nodiscard]]
consteval
bool
operator==(
basic_fixed_string const& lhs,
CharT const(& rhs)[]);
true if the objects are equal, false otherwise
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Equality operator
<mp-units/ext/fixed_string.h>
template<std::size_t N2>
[[nodiscard]]
constexpr
bool
operator==(
basic_fixed_string const& lhs,
basic_fixed_string<CharT, N2> const& rhs);
true if the objects are equal, false otherwise
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Equality operator
<mp-units/framework/symbol_text.h>
template<
std::size_t N2,
std::size_t M2>
[[nodiscard]]
constexpr
bool
operator==(
symbol_text const& lhs,
symbol_text<N2, M2> const& rhs) noexcept;
true if the objects are equal, false otherwise
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Equality operator
<mp-units/framework/reference.h>
template<AssociatedUnit U2>
[[nodiscard]]
consteval
bool
operator==(
reference lhs,
U2 u2);
true if the objects are equal, false otherwise
| Name | Description |
|---|---|
| lhs | The left operand |
| u2 | The right operand |
Equality operator
<mp-units/framework/reference.h>
template<
typename Q2,
typename U2>
[[nodiscard]]
consteval
bool
operator==(
reference lhs,
reference<Q2, U2> rhs);
true if the objects are equal, false otherwise
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Equality operator
<mp-units/framework/quantity.h>
template<
std::derived_from<quantity> Q,
RepresentationOf<quantity_spec> Value>
requires detail::DimensionlessOne<Q::reference> && std::equality_comparable_with<rep, Value>
[[nodiscard]]
constexpr
bool
operator==(
Q const& lhs,
Value const& rhs);
true if the objects are equal, false otherwise
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Equality operator
<mp-units/framework/quantity.h>
template<
std::derived_from<quantity> Q,
auto R2,
typename Rep2>
requires requires { typename std::common_type_t<quantity, quantity<R2, Rep2>>; } &&
std::equality_comparable<typename std::common_type_t<quantity, quantity<R2, Rep2>>::rep>
[[nodiscard]]
constexpr
bool
operator==(
Q const& lhs,
quantity<R2, Rep2> const& rhs);
true if the objects are equal, false otherwise
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Equality operator
<mp-units/framework/quantity_point.h>
template<
std::derived_from<quantity_point> QP,
QuantityPointOf<absolute_point_origin> QP2>
requires std::equality_comparable_with<quantity_type, typename QP2::quantity_type>
[[nodiscard]]
constexpr
bool
operator==(
QP const& lhs,
QP2 const& rhs);
true if the objects are equal, false otherwise
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Three-way comparison operators
<mp-units/ext/fixed_string.h>Three-way comparison operator
template<std::size_t N2>
[[nodiscard]]
consteval
auto
operator<=>(
basic_fixed_string const& lhs,
CharT const(& rhs)[]);
» more...
Three-way comparison operator
template<std::size_t N2>
[[nodiscard]]
constexpr
auto
operator<=>(
basic_fixed_string const& lhs,
basic_fixed_string<CharT, N2> const& rhs);
» more...
Three-way comparison operator
template<
std::size_t N2,
std::size_t M2>
[[nodiscard]]
constexpr
auto
operator<=>(
symbol_text const& lhs,
symbol_text<N2, M2> const& rhs) noexcept;
» more...
Three-way comparison operator
template<
std::derived_from<quantity> Q,
RepresentationOf<quantity_spec> Value>
requires detail::DimensionlessOne<Q::reference> && std::three_way_comparable_with<rep, Value>
[[nodiscard]]
constexpr
auto
operator<=>(
Q const& lhs,
Value const& rhs);
» more...
Three-way comparison operator
template<
std::derived_from<quantity> Q,
auto R2,
typename Rep2>
requires requires { typename std::common_type_t<quantity, quantity<R2, Rep2>>; } &&
std::three_way_comparable<typename std::common_type_t<quantity, quantity<R2, Rep2>>::rep>
[[nodiscard]]
constexpr
auto
operator<=>(
Q const& lhs,
quantity<R2, Rep2> const& rhs);
» more...
Three-way comparison operator
template<
std::derived_from<quantity_point> QP,
QuantityPointOf<absolute_point_origin> QP2>
requires std::three_way_comparable_with<quantity_type, typename QP2::quantity_type>
[[nodiscard]]
constexpr
auto
operator<=>(
QP const& lhs,
QP2 const& rhs);
» more...
Three-way comparison operator
<mp-units/ext/fixed_string.h>
template<std::size_t N2>
[[nodiscard]]
consteval
auto
operator<=>(
basic_fixed_string const& lhs,
CharT const(& rhs)[]);
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Three-way comparison operator
<mp-units/ext/fixed_string.h>
template<std::size_t N2>
[[nodiscard]]
constexpr
auto
operator<=>(
basic_fixed_string const& lhs,
basic_fixed_string<CharT, N2> const& rhs);
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Three-way comparison operator
<mp-units/framework/symbol_text.h>
template<
std::size_t N2,
std::size_t M2>
[[nodiscard]]
constexpr
auto
operator<=>(
symbol_text const& lhs,
symbol_text<N2, M2> const& rhs) noexcept;
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Three-way comparison operator
<mp-units/framework/quantity.h>
template<
std::derived_from<quantity> Q,
RepresentationOf<quantity_spec> Value>
requires detail::DimensionlessOne<Q::reference> && std::three_way_comparable_with<rep, Value>
[[nodiscard]]
constexpr
auto
operator<=>(
Q const& lhs,
Value const& rhs);
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Three-way comparison operator
<mp-units/framework/quantity.h>
template<
std::derived_from<quantity> Q,
auto R2,
typename Rep2>
requires requires { typename std::common_type_t<quantity, quantity<R2, Rep2>>; } &&
std::three_way_comparable<typename std::common_type_t<quantity, quantity<R2, Rep2>>::rep>
[[nodiscard]]
constexpr
auto
operator<=>(
Q const& lhs,
quantity<R2, Rep2> const& rhs);
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
Three-way comparison operator
<mp-units/framework/quantity_point.h>
template<
std::derived_from<quantity_point> QP,
QuantityPointOf<absolute_point_origin> QP2>
requires std::three_way_comparable_with<quantity_type, typename QP2::quantity_type>
[[nodiscard]]
constexpr
auto
operator<=>(
QP const& lhs,
QP2 const& rhs);
| Name | Description |
|---|---|
| lhs | The left operand |
| rhs | The right operand |
<mp-units/framework/construction_helpers.h>
[[deprecated]]
template<Reference auto R>
constexpr point_<decltype(R)> absolute = {};
<mp-units/framework/construction_helpers.h>
template<Reference auto R>
constexpr delta_<decltype(R)> delta = {};
<mp-units/framework/dimension.h>
inline constexpr dimension_one dimension_one = dimension_one;
Quantity of dimension one
<mp-units/framework/quantity_spec.h>
inline constexpr dimensionless dimensionless = dimensionless;
Quantity of dimension one also commonly named as "dimensionless" is a quantity with a dimension for which all the exponents of the factors corresponding to the base dimensions are zero.
//////////// REAL SCALAR ///////////////
<mp-units/framework/representation_concepts.h>
template<typename T>
constexpr bool disable_real = false;
<mp-units/framework/representation_concepts.h>
template<>
inline constexpr bool disable_real<bool> = true;
<mp-units/framework/representation_concepts.h>
inline constexpr /* implementation-defined */ imag = imag;
<mp-units/framework/customization_points.h>
[[deprecated]]
template<typename Rep>
constexpr bool is_complex = false;
<mp-units/ext/type_traits.h>
template<
typename T,
template<typename...> typename Type>
constexpr bool is_derived_from_specialization_of = requires(T* t) { detail::to_base_specialization_of<Type>(t); };
<mp-units/ext/type_traits.h>
template<
typename T,
template<auto...> typename Type>
constexpr bool is_derived_from_specialization_of_v = requires(T* t) { detail::to_base_specialization_of_v<Type>(t); };
<mp-units/framework/quantity_spec.h>
inline constexpr is_kind is_kind = is_kind;
<mp-units/ext/type_traits.h>
template<
class T,
class U>
constexpr bool is_same_v = false;
<mp-units/ext/type_traits.h>
template<class T>
constexpr bool is_same_v<T, T> = true;
<mp-units/framework/customization_points.h>
[[deprecated]]
template<typename Rep>
constexpr bool is_scalar = false;
<mp-units/ext/type_traits.h>
template<
typename T,
template<typename...> typename Type>
constexpr bool is_specialization_of = false;
<mp-units/ext/type_traits.h>
template<
typename... Params,
template<typename...> typename Type>
constexpr bool is_specialization_of<Type<Params...>, Type> = true;
<mp-units/ext/type_traits.h>
template<
typename T,
template<auto...> typename Type>
constexpr bool is_specialization_of_v = false;
<mp-units/ext/type_traits.h>
template<
auto Params...,
template<auto...> typename Type>
constexpr bool is_specialization_of_v<Type<Params...>, Type> = true;
<mp-units/framework/customization_points.h>
[[deprecated]]
template<typename Rep>
constexpr bool is_tensor = false;
Specifies if a specific conversion between two types preserves the value
<mp-units/framework/customization_points.h>
template<
typename From,
typename To>
constexpr bool is_value_preserving = treat_as_floating_point<To> || !treat_as_floating_point<From>;
This type trait should be specialized for a custom representation types to specify weather the conversion from the source type to the destination type preserves the value or not. Value-truncating conversions should be forced by the user with explicit casts.
| Name | Description |
|---|---|
| From | a source representation type |
| To | a destination representation type |
<mp-units/framework/customization_points.h>
[[deprecated]]
template<typename Rep>
constexpr bool is_vector = false;
<mp-units/framework/quantity_spec.h>
template<QuantitySpec auto Q>
requires requires { typename kind_of_<decltype(Q)>; }
constexpr kind_of_<decltype(Q)> kind_of;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
<mp-units/framework/unit_magnitude.h>
[[deprecated]]
template<intmax_t N>
constexpr std::optional<intmax_t> known_first_factor = std::nullopt;
<mp-units/framework/unit_magnitude.h>
template</* implementation-defined */ auto V>
requires (detail::get_base_value(V) > 0)
constexpr UnitMagnitude auto mag = detail::make_magnitude<V>();
<mp-units/framework/unit_magnitude.h>
[[deprecated]]
inline constexpr UnitMagnitude auto mag_pi = mag<pi>;
Create a Magnitude which is some rational number raised to a rational power.
<mp-units/framework/unit_magnitude.h>
template<
/* implementation-defined */ auto Base,
int Num,
int Den = 1>
requires (detail::get_base_value(Base) > 0)
constexpr UnitMagnitude auto mag_power = pow<Num, Den>(mag<Base>);
<mp-units/framework/unit_magnitude.h>
template<
intmax_t N,
intmax_t D>
requires (N > 0)
constexpr UnitMagnitude auto mag_ratio = detail::prime_factorization_v<N> / detail::prime_factorization_v<D>;
<mp-units/framework/representation_concepts.h>
inline constexpr /* implementation-defined */ magnitude = magnitude;
<mp-units/framework/representation_concepts.h>
inline constexpr /* implementation-defined */ modulus = modulus;
<mp-units/framework/unit.h>
inline constexpr parts_per_million parts_per_million = parts_per_million;
<mp-units/framework/construction_helpers.h>
template<Reference auto R>
constexpr point_<decltype(R)> point = {};
<mp-units/framework/unit.h>
inline constexpr auto ppm = parts_per_million;
<mp-units/framework/representation_concepts.h>
inline constexpr /* implementation-defined */ real = real;
Puts a space ' ' sign before a unit symbol
<mp-units/framework/unit.h>
template<Unit auto U>
constexpr bool space_before_unit_symbol = true;
Quantities of some units (e.g. degree, arcminute, arcsecond) should not be printed with the space between a number and a unit. For those a partial specialization with the value false should be provided.
Specifies if a value of a type should be treated as a floating-point value
<mp-units/framework/customization_points.h>
template<typename Rep>
constexpr bool treat_as_floating_point = std::chrono::treat_as_floating_point_v<value_type_t<Rep>>;
This type trait should be specialized for a custom representation type to specify that values of this type should be treated by the library as a floating-point ones which will enable implicit conversions between quantities.
| Name | Description |
|---|---|
| Rep | a representation type for which a type trait is defined |
<mp-units/framework/quantity_point.h>
template<QuantitySpec auto QS>
constexpr zeroth_point_origin_<QS> zeroth_point_origin;
<mp-units/framework/unit_magnitude.h>
inline constexpr auto π = pi;
A concept matching all units that can be used as quantity references
<mp-units/framework/unit_concepts.h>
template<typename U>
concept AssociatedUnit = Unit<U> && detail::has_associated_quantity(U{});
A concept matching all dimensions in the library.
<mp-units/framework/dimension_concepts.h>
template<typename T>
concept Dimension = std::derived_from<T, detail::dimension_interface> && detail::SymbolicConstant<T>;
Satisfied by all dimension types in the library.
A concept checking if the argument is of the same dimension.
<mp-units/framework/dimension_concepts.h>
template<
typename T,
auto D>
concept DimensionOf = Dimension<T> && Dimension<MP_UNITS_REMOVE_CONST(decltype(D))> && (T{} == D);
Satisfied when both argument satisfy a Dimension concept and when they compare equal.
A concept matching all quantity point origins in the library
<mp-units/framework/quantity_point_concepts.h>
template<typename T>
concept PointOrigin = std::derived_from<T, detail::point_origin_interface> && detail::SymbolicConstant<T>;
Satisfied by either quantity points or by all types derived from absolute_point_origin class template.
A concept matching all quantity point origins for a specified quantity type in the library
<mp-units/framework/quantity_point_concepts.h>
template<
typename T,
auto QS>
concept PointOriginFor = PointOrigin<T> && QuantitySpecOf<MP_UNITS_REMOVE_CONST(decltype(QS)), T::_quantity_spec_>;
Satisfied by all quantity point origins that are defined using a provided quantity specification.
A concept to be used to define prefixes for a unit
<mp-units/framework/unit_concepts.h>
template<typename T>
concept PrefixableUnit = Unit<T> && is_derived_from_specialization_of_v<T, named_unit>;
A concept matching all quantities in the library
<mp-units/framework/quantity_concepts.h>
template<typename T>
concept Quantity = detail::is_derived_from_specialization_of_quantity<T>;
Satisfied by all types being a either specialization or derived from quantity
A concept matching all external quantities like types
<mp-units/framework/quantity_concepts.h>
template<typename T>
concept QuantityLike = !Quantity<T> && detail::QuantityLikeImpl<T, quantity_like_traits> && requires {
typename quantity<quantity_like_traits<T>::reference, typename quantity_like_traits<T>::rep>;
};
Satisfied by all external types (not-defined in mp-units) that via a quantity_like_traits provide all quantity-specific information.
A concept matching all quantities of the provided quantity spec
<mp-units/framework/quantity_concepts.h>
template<
typename Q,
auto QS>
concept QuantityOf = Quantity<Q> && QuantitySpec<MP_UNITS_REMOVE_CONST(decltype(QS))> &&
ReferenceOf<MP_UNITS_NONCONST_TYPE(Q::reference), QS>;
Satisfied by all quantities with the reference satisfying ReferenceOf<QS>.
A concept matching all quantity points in the library
<mp-units/framework/quantity_point_concepts.h>
template<typename T>
concept QuantityPoint = detail::is_quantity_point<T>;
Satisfied by all types being either a specialization or derived from quantity_point
A concept matching all external quantity point like types
<mp-units/framework/quantity_point_concepts.h>
template<typename T>
concept QuantityPointLike = !QuantityPoint<T> && detail::QuantityLikeImpl<T, quantity_point_like_traits> && requires {
typename quantity_point<quantity_point_like_traits<T>::reference, quantity_point_like_traits<T>::point_origin,
typename quantity_point_like_traits<T>::rep>;
};
Satisfied by all external types (not-defined in mp-units) that via a quantity_point_like_traits provide all quantity_point-specific information.
A concept matching all quantity points of the provided property
<mp-units/framework/quantity_point_concepts.h>
template<
typename QP,
auto V>
concept QuantityPointOf = QuantityPoint<QP> && (ReferenceOf<MP_UNITS_NONCONST_TYPE(QP::reference), V> ||
detail::SameAbsolutePointOriginAs<MP_UNITS_NONCONST_TYPE(QP::absolute_point_origin), V>);
Satisfied by all quantity points with a quantity_spec being the instantiation derived from the provided quantity_spec type, or quantity points having the origin with the same absolute_point_origin.
<mp-units/framework/quantity_spec_concepts.h>
template<typename T>
concept QuantitySpec = std::derived_from<T, detail::quantity_spec_interface_base> && detail::SymbolicConstant<T>;
A concept matching all quantity specifications of a provided quantity spec value
<mp-units/framework/quantity_spec_concepts.h>
template<
typename T,
auto QS>
concept QuantitySpecOf = QuantitySpec<T> && QuantitySpec<MP_UNITS_REMOVE_CONST(decltype(QS))> && (mp_units::implicitly_convertible(T{}, QS));
Satisfied by all quantity specifications that are implicitly convertible to the provided QS value.
A concept matching all references in the library.
<mp-units/framework/reference_concepts.h>
template<typename T>
concept Reference = MP_UNITS_ASSOCIATED_UNIT_T(T) || is_specialization_of<T, reference>;
Satisfied by all specializations of reference.
A concept matching all references of the provided quantity spec
<mp-units/framework/reference_concepts.h>
template<
typename T,
auto QS>
concept ReferenceOf = Reference<T> && QuantitySpec<MP_UNITS_REMOVE_CONST(decltype(QS))> &&
QuantitySpecOf<decltype(get_quantity_spec(T{})), QS>;
Satisfied by all references for which QuantitySpecOf<QS> is true.
<mp-units/framework/representation_concepts.h>
template<
typename T,
auto V>
concept RepresentationOf = ((QuantitySpec<MP_UNITS_REMOVE_CONST(decltype(V))> &&
((detail::QuantityKindSpec<MP_UNITS_REMOVE_CONST(decltype(V))> && detail::SomeRepresentation<T>) ||
detail::IsOfCharacter<T, V.character>)) ||
(std::same_as<quantity_character, decltype(V)> && detail::IsOfCharacter<T, V>));
A concept matching all unit types in the library
<mp-units/framework/unit_concepts.h>
template<typename T>
concept Unit = std::derived_from<T, detail::unit_interface> && detail::SymbolicConstant<T>;
Satisfied by all unit types provided by the library.
Concept to detect whether T is a valid UnitMagnitude.
<mp-units/framework/unit_magnitude_concepts.h>
template<typename T>
concept UnitMagnitude = is_specialization_of_v<T, detail::unit_magnitude>;
A concept matching all units associated with the provided quantity spec
<mp-units/framework/unit_concepts.h>
template<
typename U,
auto QS>
concept UnitOf = MP_UNITS_ASSOCIATED_UNIT<U> && QuantitySpec<MP_UNITS_REMOVE_CONST(decltype(QS))> &&
(implicitly_convertible(get_quantity_spec(U{}), QS) ||
(unsatisfied<"Unit '{}' is associated with quantity of kind '{}' which is not convertible to the '{}' quantity">(
U{}, type_name(get_quantity_spec(U{})._quantity_spec_), type_name(QS))));
Satisfied by all units for which an associated quantity spec is implicitly convertible to the provided QS value.
<mp-units/ext/fixed_string.h>
template<
typename CharT,
std::size_t N>
basic_fixed_string<CharT, N - 1>(CharT const(& str)[]) -> basic_fixed_string<CharT, N - 1>;
<mp-units/ext/fixed_string.h>
template<
typename CharT,
std::same_as<CharT>... Rest>
basic_fixed_string<CharT, 1 + sizeof...(Rest)>(
CharT,
Rest...) -> basic_fixed_string<CharT, 1 + sizeof...(Rest)>;
<mp-units/ext/fixed_string.h>
template<
typename CharT,
std::size_t N>
basic_fixed_string<CharT, N>(
std::from_range_t,
std::array<CharT, N>) -> basic_fixed_string<CharT, N>;
<mp-units/cartesian_vector.h>
template<
typename Arg,
typename... Args>
requires (sizeof...(Args) <= 2) && requires { typename std::common_type_t<Arg, Args...>; }
cartesian_vector<std::common_type_t<Arg, Args...>>(
Arg,
Args...) -> cartesian_vector<std::common_type_t<Arg, Args...>>;
<mp-units/framework/quantity.h>
template<QuantityLike Q>
quantity<quantity_like_traits<Q>::reference, quantity_like_traits<Q>::rep>(Q) -> quantity<quantity_like_traits<Q>::reference, quantity_like_traits<Q>::rep>;
<mp-units/framework/quantity.h>
template<
Reference R,
RepresentationOf<get_quantity_spec(R{})> Value>
quantity<R{}, Value>(
Value v,
R) -> quantity<R{}, Value>;
<mp-units/framework/quantity_point.h>
template<Quantity Q>
quantity_point<Q::reference, default_point_origin(Q::reference), Q::rep>(Q q) -> quantity_point<Q::reference, default_point_origin(Q::reference), Q::rep>;
<mp-units/framework/quantity_point.h>
template<QuantityPointLike QP>
quantity_point<quantity_point_like_traits<QP>::reference, quantity_point_like_traits<QP>::point_origin, quantity_point_like_traits<QP>::rep>(QP) -> quantity_point<quantity_point_like_traits<QP>::reference, quantity_point_like_traits<QP>::point_origin, quantity_point_like_traits<QP>::rep>;
<mp-units/framework/quantity_point.h>
template<
Quantity Q,
PointOriginFor<Q::quantity_spec> PO>
quantity_point<Q::reference, PO{}, Q::rep>(
Q q,
PO) -> quantity_point<Q::reference, PO{}, Q::rep>;
<mp-units/framework/symbol_text.h>
symbol_text<1, 1>(char) -> symbol_text<1, 1>;
<mp-units/framework/symbol_text.h>
template<std::size_t N>
symbol_text<N, N>(fixed_string<N> const&) -> symbol_text<N, N>;
<mp-units/framework/symbol_text.h>
template<std::size_t N>
symbol_text<N - 1, N - 1>(char const(&)[]) -> symbol_text<N - 1, N - 1>;
<mp-units/framework/symbol_text.h>
template<
std::size_t N,
std::size_t M>
symbol_text<N, M>(
fixed_u8string<N> const&,
fixed_string<M> const&) -> symbol_text<N, M>;
<mp-units/framework/symbol_text.h>
template<
std::size_t N,
std::size_t M>
symbol_text<N - 1, M - 1>(
char8_t const(&)[],
char const(&)[]) -> symbol_text<N - 1, M - 1>;