Affected subclause: [container.requirements]
Change: Complexity of
size() member functions now constant
. Rationale: Lack of specification of complexity of
size() resulted in
divergent implementations with inconsistent performance characteristics
. Effect on original feature: Some container implementations that conform to C++ 2003 may not conform to the
specified
size() requirements in this International Standard
. Adjusting
containers such as
std::list to the stricter requirements may require
incompatible changes
. Affected subclauses: [sequence.reqmts] and
[associative.reqmts]
Change: Signature changes: from
void return types
. Rationale: Old signature threw away useful information that may be expensive
to recalculate
. Effect on original feature: The following member functions have changed:
- erase(iter) for set, multiset, map, multimap
- erase(begin, end) for set, multiset, map, multimap
- insert(pos, num, val) for vector, deque, list, forward_list
- insert(pos, beg, end) for vector, deque, list, forward_list
Valid C++ 2003 code that relies on these functions returning
void
(e.g., code that creates a pointer to member function that points to one
of these functions) will fail to compile with this International Standard
.