Title
set::find() missing const overload
Status
cd1
Section
[set] [multiset]
Submitter
Judy Ward

Created on 2000-02-28.00:00:00 last changed 164 months ago

Messages

Date: 2010-10-21.18:28:33

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

Date: 2010-10-21.18:28:33

Proposed resolution:

Change the prototypes for find(), lower_bound(), upper_bound(), and equal_range() in section [set] and section [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;
Date: 2000-02-28.00:00:00

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;
History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg1878
2010-10-21 18:28:33adminsetmessages: + msg1877
2000-02-28 00:00:00admincreate