C++ named requirements: Container

A Container is an object used to store other objects and taking care of the management of the memory used by the objects it contains.

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
LWG 179C++98iterator and const_iterator types might be incomparablerequired to be comparable
LWG 276C++98T was required to be CopyAssignableT is required to beCopyConstructible
LWG 322C++98the value types of iterator and const_iterator were not specifiedspecified as T
LWG 774C++98there was no requirement on swap(a, b)added
LWG 883C++98a.swap(b) was defined as swap(a, b),resulted in circular definitiondefined as exchangingthe values of a and b
LWG 1319C++98iterator and const_iteratormight not have multipass guaranteethey are required to satisfythe requirements ofLegacyForwardIterator
LWG 2114(P2167R3)C++98non-bool return types of some functions were alloweddisallowed
LWG 2182C++98the types deonted by reference andconst_reference were poorly specifiedimproved wording
LWG 2257C++98two containers required linear time to compareequal even if they have different sizesonly requires constanttime in this case
LWG 2263C++11the resolution of LWG issue 179 was accidentally dropped in C++11restored
LWG 2839C++11self move assignment of standard containers was not allowedallowed but theresult is unspecified
N3346C++11C::value_type was required to be Destructiblerequired to be Erasable from C

# See also