1126. istreambuff_iterator::equal needs a const & parameter

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

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:
27.6.3 [istreambuf.iterator]
99 [istreambuf.iterator::equal]

bool equal(const istreambuf_iterator& b) const;