214. set::find() missing const overload

Section: 26.4.6 [set], 26.4.7 [multiset] Status: CD1 Submitter: Judy Ward Opened: 2000-02-28 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [set].

View all issues with CD1 status.

Duplicate of: 450


The specification for the associative container requirements in Table 69 state that the find member function should "return iterator; const_iterator for constant a". The map and multimap container descriptions have two overloaded versions of find, but set and multiset do not, all they have is:

iterator find(const key_type & x) const;

Proposed resolution:

Change the prototypes for find(), lower_bound(), upper_bound(), and equal_range() in section 26.4.6 [set] and section 26.4.7 [multiset] to each have two overloads:

iterator find(const key_type & x);
const_iterator find(const key_type & x) const;
iterator lower_bound(const key_type & x);
const_iterator lower_bound(const key_type & x) const;
iterator upper_bound(const key_type & x);
const_iterator upper_bound(const key_type & x) const;
pair<iterator, iterator> equal_range(const key_type & x);
pair<const_iterator, const_iterator> equal_range(const key_type & x) const;

[Tokyo: At the request of the LWG, Judy Ward provided wording extending the proposed resolution to lower_bound, upper_bound, and equal_range.]