diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2019-11-06 17:53:12 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2019-11-06 17:53:12 +0000 |
commit | d37303d15af7ff6f89989a70605a8225be0ffa6d (patch) | |
tree | 4ff82934e6d5a3e38f2892dedf6dc756b4bab405 | |
parent | 6394a341d6c4a69d61b29618bf8837002eca580f (diff) | |
download | gcc-d37303d15af7ff6f89989a70605a8225be0ffa6d.zip gcc-d37303d15af7ff6f89989a70605a8225be0ffa6d.tar.gz gcc-d37303d15af7ff6f89989a70605a8225be0ffa6d.tar.bz2 |
libstdc++: remove redundant equality operators
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
-rw-r--r-- | libstdc++-v3/ChangeLog | 7 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/iterator_concepts.h | 17 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/util/testsuite_iterators.h | 9 |
3 files changed, 7 insertions, 26 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 4f05f77..5dece5c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -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. diff --git a/libstdc++-v3/include/bits/iterator_concepts.h b/libstdc++-v3/include/bits/iterator_concepts.h index e30645e..8b39861 100644 --- a/libstdc++-v3/include/bits/iterator_concepts.h +++ b/libstdc++-v3/include/bits/iterator_concepts.h @@ -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{}; diff --git a/libstdc++-v3/testsuite/util/testsuite_iterators.h b/libstdc++-v3/testsuite/util/testsuite_iterators.h index d20257c..4c5e9a3 100644 --- a/libstdc++-v3/testsuite/util/testsuite_iterators.h +++ b/libstdc++-v3/testsuite/util/testsuite_iterators.h @@ -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 |