This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++11 status.

1126. istreambuff_iterator::equal needs a const & parameter

Section: 25.6.4.4 [istreambuf.iterator.ops] Status: C++11 Submitter: Alisdair Meredith Opened: 2009-05-28 Last modified: 2017-11-29

Priority: Not Prioritized

View all other issues in [istreambuf.iterator.ops].

View all issues with C++11 status.

Discussion:

The equal member function of istreambuf_iterator is declared const, but takes its argument by non-const reference.

This is not compatible with the operator== free function overload, which is defined in terms of calling equal yet takes both arguments by reference to const.

[ The proposed wording is consistent with 110 with status TC1. ]

[ 2009-11-02 Howard adds: ]

Set to Tentatively Ready after 5 positive votes on c++std-lib.

Proposed resolution:

Ammend in both:
25.6.4 [istreambuf.iterator]
[istreambuf.iterator::equal]

bool equal(const istreambuf_iterator& b) const;