map<Key, T, Compare> &
|
M =
map<Key, T, Compare> M1
|
Assignment.
|
|
bool
|
M ==
map<Key, T, Compare> M1
|
Equality test: Two maps are equal, if the sequences M and M1
are elementwise equal.
|
|
bool
|
M <
map<Key, T, Compare> M1
|
Returns true if M is lexicographically less than M1,
false otherwise.
|
|
iterator
|
M.begin ()
|
Returns a constant iterator referring to the first element in
map M.
|
|
iterator
|
M.end ()
|
Returns a constant past-the-end iterator of map M.
|
|
bool
|
M.empty ()
|
Returns true if M is empty.
|
|
int
|
M.size ()
|
Returns the number of items in map M.
|
|
T&
|
M [
Key k
]
|
Returns a reference to the type T value associated with
key k. If the map is constant then a const reference is
returned. In contrast to vector or deque, the pair(k,T())
is inserted into the map, if no element is associated with the key.
|
iterator
|
M.insert ( iterator pos, pair< Key ,T> val)
|
| |
Inserts val into the map if val is not already
present in M. The iterator pos is the starting point of
the search. The return value points to the inserted item.
|
|
pair<iterator, bool>
|
M.insert ( pair< Key ,T> val)
|
Inserts val into the map if val is not already
present in M. Returns a pair, where first
is the iterator that points to the inserted item or to the
item that is already present in M, and where second
is true if the insertion took place.
|
|
void
|
M.erase ( iterator pos)
|
Erases the element where pos points to.
|
|
int
|
M.erase ( Key k)
|
Erases all elements that equal k. Returns the number
of erased elements.
|