Map is a standard container of C ++. It provides a good one-to-one relationship. Creating a map in some programs can get twice the result with half the effort.
Member Functions
-
(Constructor)
-
Construct map (Public member function) // structure, such as Map <int, int> mm;
-
(Destructor)
-
Map destructor (Public member function)
-
Operator =
-
Copy container content (Public member function) // value assignment between containers
Iterators:
-
Begin
-
Return iterator to beginning (Public member function)
-
End
-
Return iterator to end (Public member function)
-
Rbegin
-
Return reverse iterator to reverse beginning (Public member function)
-
Rend
-
Return reverse iterator to reverse end (Public member function)
Capacity:
-
Empty
-
Test whether container is empty (Public member function)
-
Size
-
Return container size (Public member function)
-
Max_size
-
Return maximum size (Public member function)
Element access:
-
OPERATOR []
-
Access element (Public member function) // overload [].
Modifiers:
-
Insert
-
Insert elements (Public member function) // insert
-
Erase
-
Erase elements (Public member function) // Delete
-
Swap
-
Swap content (Public member function) // exchange between containers
-
Clear
-
Clear content (Public member function) // clear the container
OPERATIONS:
-
Find
-
Get iterator to element (Public member function) // search. It = mm. Find ('B ');
-
Count
-
Count elements with a specific key (Public member function) // counts whether an element is in the container.
-
Lower_bound
-
Return iterator to lower bound (Public member function) // locate> = Location of the container where the key is located
-
Upper_bound
-
Return iterator to upper bound (Public member function) // locate the location of the container where> key is located
-
Performance_range
-
Get range of equal elements (Public member function)
Mutimap is a key that can store duplicates. Mutimap needs to be inserted like this. multimap <char, int> mm; mm. insert (pair <char, int> ('A', 12 ));
Others are almost the same as map !.