650. regex_token_iterator and const correctness

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

Priority: Not Prioritized

View all other issues in [re.tokiter].

View all issues with CD1 status.

Discussion:

Both the class definition of regex_token_iterator (28.6.11.2 [re.tokiter]/6) and the latter member specifications (28.6.11.2.3 [re.tokiter.comp]/1+2) declare both comparison operators as non-const functions. Furtheron, both dereference operators are unexpectedly also declared as non-const in 28.6.11.2 [re.tokiter]/6 as well as in (28.6.11.2.4 [re.tokiter.deref]/1+2).

Proposed resolution:

1) In (28.6.11.2 [re.tokiter]/6) change the current declarations

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

2) In 28.6.11.2.3 [re.tokiter.comp] change the following declarations

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

3) In 28.6.11.2.4 [re.tokiter.deref] change the following declarations

const value_type& operator*() const;
const value_type* operator->() 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. ]