Share via


map Members

Reference

Constructors

map

Constructs a list of a specific size or with elements of a specific value or with a specific allocator or as a copy of some other map.

Typedefs

allocator_type

A typedef for the allocator class for the map object.

const_iterator

A typedef for a bidirectional iterator that can read a const element in the map.

const_pointer

A typedef for a pointer to a const element in a map.

const_reference

A typedef for a reference to a const element stored in a map for reading and performing const operations.

const_reverse_iterator

A type that provides a bidirectional iterator that can read any const element in the map.

difference_type

A signed integer typedef for the number of elements of a map in a range between elements pointed to by iterators.

iterator

A typedef for a bidirectional iterator that can read or modify any element in a map.

key_compare

A typedef for a function object that can compare two sort keys to determine the relative order of two elements in the map.

key_type

A typedef for the sort key stored in each element of the map.

mapped_type

A typedef for the data stored in each element of a map.

pointer

A typedef for a pointer to a const element in a map.

reference

A typedef for a reference to an element stored in a map.

reverse_iterator

A typedef for a bidirectional iterator that can read or modify an element in a reversed map.

size_type

An unsigned integer typedef for the number of elements in a map

value_type

A typedef for the type of object stored as an element in a map.

Methods

begin

Returns an iterator that points to the first element in the map.

clear

Erases all the elements of a map.

count

Returns the number of elements in a map whose key matches the key specified in a parameter.

empty

Returns true if a map is empty.

end

Returns an iterator that points to the location after the last element in a map.

equal_range

Returns a pair of iterators. The first iterator in the pair points to the first element in a map with a key that is greater than a specified key. The second iterator in the pair points to the first element in the map with a key that is equal to or greater than the key.

erase

Removes an element or a range of elements in a map from the specified positions.

find

Returns an iterator that points to the location of an element in a map that has a key equal to a specified key.

get_allocator

Returns a copy of the allocator object that is used to construct the map.

insert

Inserts an element or a range of elements into the map at a specified position.

key_comp

Returns a copy of the comparison object that used to order keys in a map.

lower_bound

Returns an iterator to the first element in a map that has a key value that is equal to or greater than that of a specified key.

max_size

Returns the maximum length of the map.

rbegin

Returns an iterator that points to the first element in a reversed map.

rend

Returns an iterator that points to the location after the last element in a reversed map.

size

Returns the number of elements in the map.

swap

Exchanges the elements of two maps.

upper_bound

Returns an iterator to the first element in a map that has a key value that is greater than that of a specified key.

value_comp

Retrieves a copy of the comparison object that is used to order element values in a map.

Operators

operator[]

Inserts an element into a map with a specified key value.

See Also

Reference

map Class

Thread Safety in the Standard C++ Library

Standard Template Library

Iterators

Change History

Date

History

Reason

October 2008

Revised description of value_type.

Customer feedback.

February 2009

Added link to Iterators topic.

Customer feedback.