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

652. regex_iterator and const correctness

Section: 32.11.1 [re.regiter] Status: CD1 Submitter: Daniel Krügler Opened: 2007-03-05 Last modified: 2016-01-28

Priority: Not Prioritized

View all issues with CD1 status.

Discussion:

Both the class definition of regex_iterator (32.11.1 [re.regiter]/1) and the latter member specification (32.11.1.3 [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 32.11.1 [re.regiter]/1 as well as in (32.11.1.4 [re.regiter.deref]/1+2).

Proposed resolution:

1) In (32.11.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 32.11.1.4 [re.regiter.deref] change the following declarations

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

3) In 32.11.1.3 [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. ]