|
| constexpr | Quantity () noexcept |
| | Default-constructs the internal value. Lower bound is used if not within range.
|
| template<typename U, typename = std::enable_if_t<std::is_convertible_v<U, T>>> |
| constexpr | Quantity (U value) |
| | Sets the value. Throws std::exception if out of range.
|
| | ~Quantity ()=default |
| constexpr T | get () const noexcept |
| | The stored value.
|
| constexpr | operator T () const noexcept |
| | The stored value.
|
| constexpr bool | isValid () const noexcept |
| | The validity of data.
|
| constexpr | operator bool () const noexcept |
| | The validity of data.
|
| template<typename U, typename = std::enable_if_t<std::is_convertible_v<U, T>>> |
| constexpr Quantity & | operator= (U other) |
| | Sets the value. Throws std::exception if out of range.
|
| template<typename U, typename = std::enable_if_t<std::is_convertible_v<U, T>>> |
| constexpr void | set (U other) |
| | Sets the value. Throws std::exception if out of range.
|
| constexpr void | setValid (bool valid) |
| | Sets the validity of data.
|
| template<typename U, typename = std::enable_if_t<std::is_convertible_v<U, T>>> |
| constexpr bool | operator== (const U &other) const |
| template<typename U, typename = std::enable_if_t<std::is_convertible_v<U, T>>> |
| constexpr bool | operator!= (const U &other) const |
| template<typename U, typename = std::enable_if_t<std::is_convertible_v<U, T>>> |
| constexpr bool | operator< (const U &other) const |
| template<typename U, typename = std::enable_if_t<std::is_convertible_v<U, T>>> |
| constexpr bool | operator<= (const U &other) const |
| template<typename U, typename = std::enable_if_t<std::is_convertible_v<U, T>>> |
| constexpr bool | operator> (const U &other) const |
| template<typename U, typename = std::enable_if_t<std::is_convertible_v<U, T>>> |
| constexpr bool | operator>= (const U &other) const |
template<typename T, typename D>
class sen::Quantity< T, D >
CRTP class that wraps T to ensure it's value stays within a certain range.