The associative container contains map, set, Multimap, Multiset.
The characteristic of the associative container is obvious, relative to the sequential container, has the following characteristics:
1, its internal is the use of non-linear two-fork tree structure, in particular, the red and black tree structure to achieve the principle.
2, set and map ensure the uniqueness of elements, multiset and Multimap extend this attribute, you can allow the element is not unique.
3, the element can be an ordered collection, by default when inserted in ascending order.
The basic usage of the associative container is the same:
Begin () returns the iterator to the first element pointed to
Clear () Clears all elements
COUNT () returns the number of elements of a value
Empty () How the collection is null and returns True
End () The iterator that returns the last element
Erase (key) deletes all elements that are equal to the key value
Erase (IT) removes the element that the IT iterator points to
Erase (Start,end) removes the element from the iterator start to end
Find () returns the first iterator that points to the found element
Insert (It,val) inserts Val before iterator it
Lower_bound (Val) returns an iterator that points to the first element greater than (or equal to) the Val value
Upper_bount (Val) returns an iterator that points to the first element greater than Val
The number of elements in the size () collection
STL's associated container