This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++17 status.
istreambuf_iterator::operator->
Section: 24.6.4 [istreambuf.iterator] Status: C++17 Submitter: Jonathan Wakely Opened: 2016-11-09 Last modified: 2017-07-30
Priority: 3
View other active issues in [istreambuf.iterator].
View all other issues in [istreambuf.iterator].
View all issues with C++17 status.
Discussion:
Addresses GB 59
There is no specification foristreambuf_iterator::operator->
. This
operator appears to have been added for C++11 by LWG issue 659(i),
which gave the signature, but also lacked specification.
[2016-11-08, Jonathan comments and suggests wording]
There is no good option here, and implementations either return
nullptr
, or return the address of a temporary, or don't even provide
the member at all. We took polls to decide whether to remove
istreambuf_iterator::operator->
, or specify it to return nullptr
, and
the preferred option was to remove it. It was noted that in the Ranges
TS input iterators no longer require operator->
anyway, and the
library never tries to use it.
[Issues Telecon 16-Dec-2016]
Move to Review
Proposed resolution:
This wording is relative to N4606.
Remove the note in paragraph 1 of 24.6.4 [istreambuf.iterator]:
The class template
istreambuf_iterator
defines an input iterator (24.2.3) that reads successive characters from the streambuf for which it was constructed.operator*
provides access to the current input character, if any.[Note:Each timeoperator->
may return a proxy. — end note]operator++
is evaluated, the iterator advances to the next input character. […]
Remove the member from the class synopsis in 24.6.4 [istreambuf.iterator]:
charT operator*() const;pointer operator->() const;istreambuf_iterator& operator++(); proxy operator++(int);