Skip to content

Commit fc31920

Browse files
author
Arthur O'Dwyer
committed
[libc++] Give MoveOnly all six comparison operators, not just == and <.
Split out of D93512.
1 parent 927af4b commit fc31920

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libcxx/test/support/MoveOnly.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ class MoveOnly
3232
constexpr int get() const {return data_;}
3333

3434
constexpr bool operator==(const MoveOnly& x) const {return data_ == x.data_;}
35+
constexpr bool operator!=(const MoveOnly& x) const {return data_ != x.data_;}
3536
constexpr bool operator< (const MoveOnly& x) const {return data_ < x.data_;}
37+
constexpr bool operator<=(const MoveOnly& x) const {return data_ <= x.data_;}
38+
constexpr bool operator> (const MoveOnly& x) const {return data_ > x.data_;}
39+
constexpr bool operator>=(const MoveOnly& x) const {return data_ >= x.data_;}
3640
TEST_CONSTEXPR_CXX14 MoveOnly operator+(const MoveOnly& x) const
3741
{ return MoveOnly{data_ + x.data_}; }
3842
TEST_CONSTEXPR_CXX14 MoveOnly operator*(const MoveOnly& x) const

0 commit comments

Comments
 (0)