Template Struct quantity¶
Defined in File quantity.hpp
Struct Documentation¶
-
template<QuantitySpec U, Numeric Rep = f_t>
struct quantity¶ A quantity wraps an underlying numeric representation with static units.
- Template Parameters:
U – the quantity spec, specifying units, dimensions and magnitude
Rep – the underlying numeric representations (defaults to the standard floating point
f_t)
Public Types
Public Functions
-
constexpr quantity() noexcept = default¶
-
template<QuantitySpecOf<U> U2, Numeric Rep2>
inline constexpr quantity(const quantity<U2, Rep2> &q) noexcept¶
-
template<QuantitySpecOf<U> U2, Numeric Rep2>
inline constexpr bool operator==(const quantity<U2, Rep2> &o) const noexcept¶
-
template<QuantitySpecOf<U> U2, Numeric Rep2>
inline constexpr bool operator!=(const quantity<U2, Rep2> &o) const noexcept¶
-
template<QuantitySpecOf<U> U2, Numeric Rep2>
inline constexpr bool operator>=(const quantity<U2, Rep2> &o) const noexcept¶
-
template<QuantitySpecOf<U> U2, Numeric Rep2>
inline constexpr bool operator<=(const quantity<U2, Rep2> &o) const noexcept¶
-
template<QuantitySpecOf<U> U2, Numeric Rep2>
inline constexpr bool operator>(const quantity<U2, Rep2> &o) const noexcept¶
-
template<QuantitySpecOf<U> U2, Numeric Rep2>
inline constexpr bool operator<(const quantity<U2, Rep2> &o) const noexcept¶
-
inline constexpr auto operator+() const noexcept¶
-
inline constexpr auto operator-() const noexcept¶
-
inline constexpr auto in(wt::unit<u::unitless>) const noexcept¶
Returns the underlying representation in desired units.
-
inline constexpr auto in(auto u) const noexcept¶
Returns the underlying representation in desired units.
-
inline constexpr auto in_lossy(auto u) const noexcept¶
Returns the underlying representation in desired units. Permits lossy truncating conversions.
-
template<Unit U2>
inline constexpr auto as(U2 u) const noexcept¶ Converts to a quantity in the desired units.
-
template<Unit U2>
inline constexpr auto as_lossy(U2 u) const noexcept¶ Converts to a quantity in the desired units. Permits lossy truncating conversions.
-
template<QuantitySpec U2, Numeric Rep2>
inline explicit constexpr operator quantity<U2, Rep2>() const noexcept¶
Public Static Functions
-
static inline constexpr quantity zero() noexcept