1 Element
The element of the container is a copy of the inserted object. Therefore, the element must belong to a type that allows the container implementation to replicate the object. Containers can use the copy constructor or assign values to copy elements.
2 Comparison
The associated container requires that its elements be ordered. The default method is <operator definition. If not, you can provide more appropriate comparison operations. For example, define a function object.
For the sequence criterion CMP:
1 CMP (x, x) = false.
2 If CMP (x, y) and CMP (Y, Z), then CMP (Y, Z ).
3 define equiv (X, Y) is! (CMP (x, y) | CMP (Y, x )).
4. Other Relational operators can be constructed through <and =.
Binary Sequence
1 List
Bonding splice (). This is equivalent to cutting the paste and not copying it.
Merge () Merge and sort. In this case, make sure that the order of the two lists is the same as that of the target list. The default order for the first member function is ascending order.
Map set mulltimap Multiset
Map
By default, the key code is less than <. However, you can use the last parameter or the constructor parameter to provide an alternative operation.
For subscript []. Because [] always requires V (), if the value type of a map does not have a default value, it cannot be used for subscript operations. This is an unfortunate constraint for standard associated containers ..
For multimap, The subscripts [] are not supported, and the values of _ range (), lower_bound (), and uper_bound () are used.
Binary container string valarray bitset