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
. Rationale: Clarification
. Effect on original feature:
Valid C++ 2003 code that attempts to meet the specified container requirements
may now be over-specified
. Code that attempted to be portable across containers
may need to be adjusted as follows:
Rationale: Clarification of container requirements
. Effect on original feature:
Valid C++ 2003 code that attempts to explicitly instantiate a container using
a user-defined type with no default constructor may fail to compile
. 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
. Rationale: Overspecification
.
Effect on original feature:
The signatures of the following member functions changed from taking an
iterator to taking a const_iterator:
insert(iter, val) for vector, deque, list,
set, multiset, map, multimap
insert(pos, beg, end) for vector, deque, list,
forward_list
erase(begin, end) for set, multiset, map, multimap
all forms of list::splice
all forms of list::merge
Valid C++ 2003 code that uses these functions may fail to compile with this
International Standard
. Rationale: Performance, compatibility with move semantics
. Effect on original feature:
For
vector,
deque, and
list
the fill value passed to
resize is now passed by reference instead of
by value, and an additional overload of
resize has been added
. Valid
C++ 2003 code that uses this function may fail to compile with this International
Standard
.