libstdc++: Add relational operators to __gnu_test::PointerBase
The Cpp17Allocator requirements say that an allocator's pointer and const_pointer types must meet the Cpp17RandomAccessIterator requirements. That means our PointerBase helper for defining fancy pointer types should support the full set of relational operators. libstdc++-v3/ChangeLog: * testsuite/util/testsuite_allocator.h (PointerBase): Add relational operators.
This commit is contained in:
parent
d156c60542
commit
8d2fa90a41
1 changed files with 9 additions and 0 deletions
|
@ -719,6 +719,15 @@ namespace __gnu_test
|
|||
friend std::ptrdiff_t operator-(PointerBase l, PointerBase r)
|
||||
{ return l.value - r.value; }
|
||||
|
||||
friend bool operator<(PointerBase l, PointerBase r)
|
||||
{ return l.value < r.value; }
|
||||
friend bool operator>(PointerBase l, PointerBase r)
|
||||
{ return l.value > r.value; }
|
||||
friend bool operator<=(PointerBase l, PointerBase r)
|
||||
{ return l.value <= r.value; }
|
||||
friend bool operator>=(PointerBase l, PointerBase r)
|
||||
{ return l.value >= r.value; }
|
||||
|
||||
Derived&
|
||||
derived() { return static_cast<Derived&>(*this); }
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue