Title
Bucket (local) iterators and iterating past end
Status
c++11
Section
[unord.req]
Submitter
Sohail Somani

Created on 2008-07-22.00:00:00 last changed 161 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Change Table 97 "Unordered associative container requirements" in [unord.req]:

Table 97: Unordered associative container requirements
expressionreturn typeassertion/note pre/post-conditioncomplexity
b.begin(n) local_iterator
const_local_iterator for const b.
Pre: n shall be in the range [0,b.bucket_count()). Note: [b.begin(n), b.end(n)) is a valid range containing all of the elements in the nth bucket. b.begin(n) returns an iterator referring to the first element in the bucket. If the bucket is empty, then b.begin(n) == b.end(n). Constant
b.end(n) local_iterator
const_local_iterator for const b.
Pre: n shall be in the range [0, b.bucket_count()). b.end(n) returns an iterator which is the past-the-end value for the bucket. Constant
Date: 2010-10-21.18:28:33

[ Post Summit: ]

Recommend Tentatively Ready.

Date: 2010-10-21.18:28:33

[ San Francisco: ]

We believe that this is not a substantive change, but the proposed change to the wording is clearer than what we have now.

Date: 2008-07-22.00:00:00

Is there any language in the current draft specifying the behaviour of the following snippet?

unordered_set<int> s;
unordered_set<int>::local_iterator it = s.end(0);

// Iterate past end - the unspecified part
it++;

I don't think there is anything about s.end(n) being considered an iterator for the past-the-end value though (I think) it should be.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-21 18:28:33adminsetmessages: + msg4128
2010-10-21 18:28:33adminsetmessages: + msg4127
2010-10-21 18:28:33adminsetmessages: + msg4126
2008-07-22 00:00:00admincreate