Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/spaceship: Clause 23: Iterators #1645

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions stl/inc/iterator
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,13 @@ _NODISCARD bool operator==(const istream_iterator<_Ty, _Elem, _Traits, _Diff>& _
return _Left._Equal(_Right);
}

#if !_HAS_CXX20
template <class _Ty, class _Elem, class _Traits, class _Diff>
_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 <class _Ty, class _Elem = char, class _Traits = char_traits<_Elem>>
Expand Down Expand Up @@ -488,11 +490,13 @@ _NODISCARD bool operator==(
return _Left.equal(_Right);
}

#if !_HAS_CXX20
template <class _Elem, class _Traits>
_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 <class _Elem, class _Traits>
Expand Down
3 changes: 3 additions & 0 deletions tests/libcxx/expected_results.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions tests/libcxx/skipped_tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down