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.

691. const_local_iterator cbegin, cend missing from TR1

Section: 24.5 [unord], 99 [tr.hash] Status: CD1 Submitter: Joaquín M López Muñoz Opened: 2007-06-14 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [unord].

View all issues with CD1 status.

Discussion:

The last version of TR1 does not include the following member functions for unordered containers:

const_local_iterator cbegin(size_type n) const;
const_local_iterator cend(size_type n) const;

which looks like an oversight to me. I've checked th TR1 issues lists and the latest working draft of the C++0x std (N2284) and haven't found any mention to these menfuns or to their absence.

Is this really an oversight, or am I missing something?

Proposed resolution:

Add the following two rows to table 93 (unordered associative container requirements) in section 24.2.8 [unord.req]:

Unordered associative container requirements (in addition to container)
expression return type assertion/note pre/post-condition complexity
b.cbegin(n) const_local_iterator n shall be in the range [0, bucket_count()). Note: [b.cbegin(n), b.cend(n)) is a valid range containing all of the elements in the nth bucket. Constant
b.cend(n) const_local_iterator n shall be in the range [0, bucket_count()). Constant

Add to the synopsis in 24.5.4 [unord.map]:

const_local_iterator cbegin(size_type n) const;
const_local_iterator cend(size_type n) const;

Add to the synopsis in 24.5.5 [unord.multimap]:

const_local_iterator cbegin(size_type n) const;
const_local_iterator cend(size_type n) const;

Add to the synopsis in 24.5.6 [unord.set]:

const_local_iterator cbegin(size_type n) const;
const_local_iterator cend(size_type n) const;

Add to the synopsis in 24.5.7 [unord.multiset]:

const_local_iterator cbegin(size_type n) const;
const_local_iterator cend(size_type n) const;