[libc++] Give `MoveOnly` all six comparison operators, not just == and <.

Split out of D93512.
This commit is contained in:
Arthur O'Dwyer 2021-01-25 17:00:14 -05:00
parent 927af4b3c5
commit fc3192026b
1 changed files with 4 additions and 0 deletions

View File

@ -32,7 +32,11 @@ public:
constexpr int get() const {return data_;}
constexpr bool operator==(const MoveOnly& x) const {return data_ == x.data_;}
constexpr bool operator!=(const MoveOnly& x) const {return data_ != x.data_;}
constexpr bool operator< (const MoveOnly& x) const {return data_ < x.data_;}
constexpr bool operator<=(const MoveOnly& x) const {return data_ <= x.data_;}
constexpr bool operator> (const MoveOnly& x) const {return data_ > x.data_;}
constexpr bool operator>=(const MoveOnly& x) const {return data_ >= x.data_;}
TEST_CONSTEXPR_CXX14 MoveOnly operator+(const MoveOnly& x) const
{ return MoveOnly{data_ + x.data_}; }
TEST_CONSTEXPR_CXX14 MoveOnly operator*(const MoveOnly& x) const