@@ -79,6 +79,8 @@ struct boxed
79
79
else
80
80
return boxed<T, Tag>(static_cast <T>(value));
81
81
}
82
+
83
+ [[nodiscard]] constexpr auto operator <=>(boxed const & other) const noexcept = default ;
82
84
};
83
85
84
86
template <typename T, typename U>
@@ -94,12 +96,6 @@ template <typename T, typename U> constexpr boxed<T, U>& operator--(boxed<T, U>&
94
96
template <typename T, typename U> constexpr boxed<T, U> operator ++(boxed<T, U>& a, int ) noexcept { auto old = a; a.value ++; return old; }
95
97
template <typename T, typename U> constexpr boxed<T, U> operator --(boxed<T, U>& a, int ) noexcept { auto old = a; a.value --; return old; }
96
98
template <typename T, typename U> constexpr T const & operator *(boxed<T, U> const & a) noexcept { return a.value ; }
97
- template <typename T, typename U> constexpr bool operator <(boxed<T, U> const & a, boxed<T, U> const & b) noexcept { return a.value < b.value ; }
98
- template <typename T, typename U> constexpr bool operator >(boxed<T, U> const & a, boxed<T, U> const & b) noexcept { return a.value > b.value ; }
99
- template <typename T, typename U> constexpr bool operator <=(boxed<T, U> const & a, boxed<T, U> const & b) noexcept { return a.value <= b.value ; }
100
- template <typename T, typename U> constexpr bool operator >=(boxed<T, U> const & a, boxed<T, U> const & b) noexcept { return a.value >= b.value ; }
101
- template <typename T, typename U> constexpr bool operator ==(boxed<T, U> const & a, boxed<T, U> const & b) noexcept { return a.value == b.value ; }
102
- template <typename T, typename U> constexpr bool operator !=(boxed<T, U> const & a, boxed<T, U> const & b) noexcept { return a.value != b.value ; }
103
99
template <typename T, typename U> constexpr bool operator !(boxed<T, U> const & a) noexcept { return !a.value ; }
104
100
template <typename T, typename U> constexpr boxed<T, U> operator +(boxed<T, U> const & a, boxed<T, U> const & b) noexcept { return boxed<T, U>{a.value + b.value }; }
105
101
template <typename T, typename U> constexpr boxed<T, U> operator -(boxed<T, U> const & a, boxed<T, U> const & b) noexcept { return boxed<T, U>{a.value - b.value }; }
0 commit comments