Template Struct Value

Struct Documentation

template<typename T, typename Tag>
struct Value

Wraps a geometry value and prevents it from being accidentally used for invalid operations (such as setting a width to a height or adding two x positions together). Of course, explicit casts are possible to get around these restrictions (see the as_*() functions).

Public Types

using ValueType = T
using TagType = Tag

Public Functions

template<typename Q = T>
inline constexpr std::enable_if<std::is_integral<Q>::value, int>::type as_int() const
template<typename Q = T>
inline constexpr std::enable_if<std::is_integral<Q>::value, uint32_t>::type as_uint32_t() const
inline constexpr T as_value() const noexcept
inline constexpr Value() noexcept
inline Value &operator=(Value const &that) noexcept
inline constexpr Value(Value const &that) noexcept
template<typename U>
inline explicit constexpr Value(Value<U, Tag> const &value) noexcept
template<typename U, typename std::enable_if<std::is_scalar<U>::value, bool>::type = true>
inline explicit constexpr Value(U const &value) noexcept

Protected Attributes

T value

Friends

friend auto operator<=>(Value const &lhs, Value const &rhs) = default