652. regex_iterator and const correctness

Section: 31.12.1 [re.regiter] Status: CD1 Submitter: Daniel Krügler Opened: 2007-03-05 Last modified: 2016-02-10

Priority: Not Prioritized

View all issues with CD1 status.

Discussion:

Both the class definition of regex_iterator (31.12.1 [re.regiter]/1) and the latter member specification (31.12.1.2 [re.regiter.comp]/1+2) declare both comparison operators as non-const functions. Furtheron, both dereference operators are unexpectedly also declared as non-const in 31.12.1 [re.regiter]/1 as well as in (31.12.1.3 [re.regiter.deref]/1+2).

Proposed resolution:

1) In (31.12.1 [re.regiter]/1) change the current declarations

bool operator==(const regex_iterator&) const;
bool operator!=(const regex_iterator&) const;
const value_type& operator*() const;
const value_type* operator->() const;

2) In 31.12.1.3 [re.regiter.deref] change the following declarations

const value_type& operator*() const;
const value_type* operator->() const;

3) In 31.12.1.2 [re.regiter.comp] change the following declarations

bool operator==(const regex_iterator& right) const;
bool operator!=(const regex_iterator& right) const;

[ Kona (2007): The LWG adopted the proposed resolution of N2409 for this issue (which is to adopt the proposed wording in this issue). The LWG voted to accelerate this issue to Ready status to be voted into the WP at Kona. ]