libstdc++: remove redundant equality operators
authorJonathan Wakely <jwakely@redhat.com>
Wed, 6 Nov 2019 17:53:12 +0000 (17:53 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 6 Nov 2019 17:53:12 +0000 (17:53 +0000)
Now that operator<=> is supported, these operators can be generated by
the compiler.

* include/bits/iterator_concepts.h (unreachable_sentinel_t): Remove
redundant equality operators.
* testsuite/util/testsuite_iterators.h (test_range::sentinel):
Likewise.

From-SVN: r277888

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/iterator_concepts.h
libstdc++-v3/testsuite/util/testsuite_iterators.h

index 4f05f774b8b2cea23626492e7d8dda309f6d76e3..5dece5c9eb5c5045a0e2f511d629042d4bd8ad82 100644 (file)
@@ -1,3 +1,10 @@
+2019-11-06  Jonathan Wakely  <jwakely@redhat.com>
+
+       * include/bits/iterator_concepts.h (unreachable_sentinel_t): Remove
+       redundant equality operators.
+       * testsuite/util/testsuite_iterators.h (test_range::sentinel):
+       Likewise.
+
 2019-11-05  Jonathan Wakely  <jwakely@redhat.com>
 
        * libsupc++/compare: New header.
index e30645e05cfd278cf6a57421a10ca3fa9fac2959..8b398616a56d087d3eeb96ab7f520a1d19deccb7 100644 (file)
@@ -797,23 +797,6 @@ namespace ranges
       friend constexpr bool
       operator==(unreachable_sentinel_t, const _It&) noexcept
       { return false; }
-
-#ifndef __cpp_lib_three_way_comparison
-    template<weakly_incrementable _It>
-      friend constexpr bool
-      operator!=(unreachable_sentinel_t, const _It&) noexcept
-      { return true; }
-
-    template<weakly_incrementable _It>
-      friend constexpr bool
-      operator==(const _It&, unreachable_sentinel_t) noexcept
-      { return false; }
-
-    template<weakly_incrementable _It>
-      friend constexpr bool
-      operator!=(const _It&, unreachable_sentinel_t) noexcept
-      { return true; }
-#endif
   };
 
   inline constexpr unreachable_sentinel_t unreachable_sentinel{};
index d20257c1b3105dd36c7b1d365be78090d3a96de9..4c5e9a3cc1d5e96a29344eaccefbff2d370e8306 100644 (file)
@@ -677,15 +677,6 @@ namespace __gnu_test
 
          friend bool operator==(const sentinel& s, const I& i)
          { return s.end == i.ptr; }
-
-         friend bool operator!=(const sentinel& s, const I& i)
-         { return !(s == i); }
-
-         friend bool operator==(const I& i, const sentinel& s)
-         { return s == i; }
-
-         friend bool operator!=(const I& i, const sentinel& s)
-         { return !(s == i); }
        };
 
       auto