]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Add default_sentinel support to stream iterators
authorJonathan Wakely <jwakely@redhat.com>
Mon, 24 Feb 2020 13:11:31 +0000 (13:11 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 24 Feb 2020 13:39:18 +0000 (13:39 +0000)
commit120e873484f20d9a0b8400e2e464ac5b2088a747
treeff85bf825e28dc76d68a89a0b614502e79d097da
parente03069be127cbc9d134d3f6b3c41461fed630444
libstdc++: Add default_sentinel support to stream iterators

Missing pieces of P0896R4 "The One Ranges Proposal" for C++20.

* include/bits/stream_iterator.h (istream_iterator(default_sentinel_t)):
Add constructor.
(operator==(istream_iterator, default_sentinel_t)): Add operator.
(ostream_iterator::difference_type): Define to ptrdiff_t for C++20.
* include/bits/streambuf_iterator.h
(istreambuf_iterator(default_sentinel_t)): Add constructor.
(operator==(istreambuf_iterator, default_sentinel_t)): Add operator.
* testsuite/24_iterators/istream_iterator/cons/sentinel.cc:
New test.
* testsuite/24_iterators/istream_iterator/sentinel.cc: New test.
* testsuite/24_iterators/istreambuf_iterator/cons/sentinel.cc:
New test.
* testsuite/24_iterators/istreambuf_iterator/sentinel.cc: New test.
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stream_iterator.h
libstdc++-v3/include/bits/streambuf_iterator.h
libstdc++-v3/testsuite/24_iterators/istream_iterator/cons/sentinel.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/istream_iterator/sentinel.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/cons/sentinel.cc [new file with mode: 0644]
This page took 0.061796 seconds and 6 git commands to generate.