From c0c087853ed85a8a4a7d4e7bd3e0ce856166826d Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 12 Feb 2021 16:14:36 -0800 Subject: [PATCH] feature/spaceship: Clause 23: Iterators --- stl/inc/iterator | 4 ++++ tests/libcxx/expected_results.txt | 3 +++ tests/libcxx/skipped_tests.txt | 3 +++ 3 files changed, 10 insertions(+) diff --git a/stl/inc/iterator b/stl/inc/iterator index ca74d58917..94210f0eeb 100644 --- a/stl/inc/iterator +++ b/stl/inc/iterator @@ -302,11 +302,13 @@ _NODISCARD bool operator==(const istream_iterator<_Ty, _Elem, _Traits, _Diff>& _ return _Left._Equal(_Right); } +#if !_HAS_CXX20 template _NODISCARD bool operator!=(const istream_iterator<_Ty, _Elem, _Traits, _Diff>& _Left, const istream_iterator<_Ty, _Elem, _Traits, _Diff>& _Right) noexcept /* strengthened */ { return !(_Left == _Right); } +#endif // !_HAS_CXX20 // CLASS TEMPLATE ostream_iterator template > @@ -488,11 +490,13 @@ _NODISCARD bool operator==( return _Left.equal(_Right); } +#if !_HAS_CXX20 template _NODISCARD bool operator!=( const istreambuf_iterator<_Elem, _Traits>& _Left, const istreambuf_iterator<_Elem, _Traits>& _Right) { return !(_Left == _Right); } +#endif // !_HAS_CXX20 // CLASS TEMPLATE ostreambuf_iterator template diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index bce3485d95..c3af7a6826 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -661,6 +661,9 @@ std/utilities/memory/util.smartptr/util.smartptr.shared/libcxx.control_block_lay # Non-Standard assumption that std::filesystem::file_time_type::duration::period is std::nano std/input.output/filesystems/fs.filesystem.synopsis/file_time_type_resolution.compile.pass.cpp FAIL +# P1614R2 "Adding Spaceship <=> To The Library" makes `std::operator!=(i1, i3)` an error +std/iterators/stream.iterators/istream.iterator/istream.iterator.ops/equal.pass.cpp FAIL + # *** LIKELY STL BUGS *** # Not yet analyzed, likely STL bugs. Assertions and other runtime failures. diff --git a/tests/libcxx/skipped_tests.txt b/tests/libcxx/skipped_tests.txt index 29a4d81729..50755983b2 100644 --- a/tests/libcxx/skipped_tests.txt +++ b/tests/libcxx/skipped_tests.txt @@ -661,6 +661,9 @@ utilities\memory\util.smartptr\util.smartptr.shared\libcxx.control_block_layout. # Non-Standard assumption that std::filesystem::file_time_type::duration::period is std::nano input.output\filesystems\fs.filesystem.synopsis\file_time_type_resolution.compile.pass.cpp +# P1614R2 "Adding Spaceship <=> To The Library" makes `std::operator!=(i1, i3)` an error +iterators\stream.iterators\istream.iterator\istream.iterator.ops\equal.pass.cpp + # *** LIKELY STL BUGS *** # Not yet analyzed, likely STL bugs. Assertions and other runtime failures.