Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/container/map"

From cppreference.com
< cpp‎ | container
m (r2.7.3) (Robot: Adding de, es, fr, pt)
m (Shorten template names. Use {{lc}} where appropriate.)
Line 15: Line 15:
  
 
===Member types===
 
===Member types===
{{dcl list begin}}
+
{{dsc begin}}
{{dcl list hitem | Member type | Definition}}
+
{{dsc hitem | Member type | Definition}}
{{dcl list template | cpp/container/dcl list key_type | map}}
+
{{dsc inc | cpp/container/dcl list key_type | map}}
{{dcl list template | cpp/container/dcl list mapped_type | map}}
+
{{dsc inc | cpp/container/dcl list mapped_type | map}}
{{dcl list template | cpp/container/dcl list value_type | map}}
+
{{dsc inc | cpp/container/dcl list value_type | map}}
{{dcl list template | cpp/container/dcl list size_type | map}}
+
{{dsc inc | cpp/container/dcl list size_type | map}}
{{dcl list template | cpp/container/dcl list difference_type | map}}
+
{{dsc inc | cpp/container/dcl list difference_type | map}}
{{dcl list template | cpp/container/dcl list key_compare | map}}
+
{{dsc inc | cpp/container/dcl list key_compare | map}}
{{dcl list template | cpp/container/dcl list allocator_type | map}}
+
{{dsc inc | cpp/container/dcl list allocator_type | map}}
{{dcl list template | cpp/container/dcl list reference | map}}
+
{{dsc inc | cpp/container/dcl list reference | map}}
{{dcl list template | cpp/container/dcl list const_reference | map}}
+
{{dsc inc | cpp/container/dcl list const_reference | map}}
{{dcl list template | cpp/container/dcl list pointer | map}}
+
{{dsc inc | cpp/container/dcl list pointer | map}}
{{dcl list template | cpp/container/dcl list const_pointer | map}}
+
{{dsc inc | cpp/container/dcl list const_pointer | map}}
{{dcl list template | cpp/container/dcl list iterator | map}}
+
{{dsc inc | cpp/container/dcl list iterator | map}}
{{dcl list template | cpp/container/dcl list const_iterator | map}}
+
{{dsc inc | cpp/container/dcl list const_iterator | map}}
{{dcl list template | cpp/container/dcl list reverse_iterator | map}}
+
{{dsc inc | cpp/container/dcl list reverse_iterator | map}}
{{dcl list template | cpp/container/dcl list const_reverse_iterator | map}}
+
{{dsc inc | cpp/container/dcl list const_reverse_iterator | map}}
{{dcl list end}}
+
{{dsc end}}
  
 
===Member classes===
 
===Member classes===
{{dcl list begin}}
+
{{dsc begin}}
{{dcl list template | cpp/container/dcl list value_compare | map}}
+
{{dsc inc | cpp/container/dcl list value_compare | map}}
{{dcl list end}}
+
{{dsc end}}
  
 
===Member functions===
 
===Member functions===
{{dcl list begin}}
+
{{dsc begin}}
{{dcl list template | cpp/container/dcl list constructor | map}}
+
{{dsc inc | cpp/container/dcl list constructor | map}}
{{dcl list template | cpp/container/dcl list destructor | map}}
+
{{dsc inc | cpp/container/dcl list destructor | map}}
{{dcl list template | cpp/container/dcl list operator{{=}} | map}}
+
{{dsc inc | cpp/container/dcl list operator{{=}} | map}}
{{dcl list template | cpp/container/dcl list get_allocator | map}}
+
{{dsc inc | cpp/container/dcl list get_allocator | map}}
  
{{dcl list h2 | Element access}}
+
{{dsc h2 | Element access}}
{{dcl list template | cpp/container/dcl list at | map}}
+
{{dsc inc | cpp/container/dcl list at | map}}
{{dcl list template | cpp/container/dcl list operator_at | map}}
+
{{dsc inc | cpp/container/dcl list operator_at | map}}
  
{{dcl list h2 | Iterators}}
+
{{dsc h2 | Iterators}}
{{dcl list template | cpp/container/dcl list begin | map}}
+
{{dsc inc | cpp/container/dcl list begin | map}}
{{dcl list template | cpp/container/dcl list end | map}}
+
{{dsc inc | cpp/container/dcl list end | map}}
{{dcl list template | cpp/container/dcl list rbegin | map}}
+
{{dsc inc | cpp/container/dcl list rbegin | map}}
{{dcl list template | cpp/container/dcl list rend | map}}
+
{{dsc inc | cpp/container/dcl list rend | map}}
  
{{dcl list h2 | Capacity}}
+
{{dsc h2 | Capacity}}
{{dcl list template | cpp/container/dcl list empty | map}}
+
{{dsc inc | cpp/container/dcl list empty | map}}
{{dcl list template | cpp/container/dcl list size | map}}
+
{{dsc inc | cpp/container/dcl list size | map}}
{{dcl list template | cpp/container/dcl list max_size | map}}
+
{{dsc inc | cpp/container/dcl list max_size | map}}
  
{{dcl list h2 | Modifiers}}
+
{{dsc h2 | Modifiers}}
{{dcl list template | cpp/container/dcl list clear | map}}
+
{{dsc inc | cpp/container/dcl list clear | map}}
{{dcl list template | cpp/container/dcl list insert | map}}
+
{{dsc inc | cpp/container/dcl list insert | map}}
{{dcl list template | cpp/container/dcl list emplace | map}}
+
{{dsc inc | cpp/container/dcl list emplace | map}}
{{dcl list template | cpp/container/dcl list emplace_hint | map}}
+
{{dsc inc | cpp/container/dcl list emplace_hint | map}}
{{dcl list template | cpp/container/dcl list erase | map}}
+
{{dsc inc | cpp/container/dcl list erase | map}}
{{dcl list template | cpp/container/dcl list swap | map}}
+
{{dsc inc | cpp/container/dcl list swap | map}}
  
{{dcl list h2 | Lookup}}
+
{{dsc h2 | Lookup}}
{{dcl list template | cpp/container/dcl list count | map}}
+
{{dsc inc | cpp/container/dcl list count | map}}
{{dcl list template | cpp/container/dcl list find | map}}
+
{{dsc inc | cpp/container/dcl list find | map}}
{{dcl list template | cpp/container/dcl list equal_range | map}}
+
{{dsc inc | cpp/container/dcl list equal_range | map}}
{{dcl list template | cpp/container/dcl list lower_bound | map}}
+
{{dsc inc | cpp/container/dcl list lower_bound | map}}
{{dcl list template | cpp/container/dcl list upper_bound | map}}
+
{{dsc inc | cpp/container/dcl list upper_bound | map}}
  
{{dcl list h2 | Observers}}
+
{{dsc h2 | Observers}}
{{dcl list template | cpp/container/dcl list key_comp | map}}
+
{{dsc inc | cpp/container/dcl list key_comp | map}}
{{dcl list template | cpp/container/dcl list value_comp | map}}
+
{{dsc inc | cpp/container/dcl list value_comp | map}}
{{dcl list end}}
+
{{dsc end}}
  
 
===Non-member functions===
 
===Non-member functions===
{{dcl list begin}}
+
{{dsc begin}}
{{dcl list template | cpp/container/dcl list operator_cmp | map}}
+
{{dsc inc | cpp/container/dcl list operator_cmp | map}}
{{dcl list template | cpp/container/dcl list swap2 | map}}
+
{{dsc inc | cpp/container/dcl list swap2 | map}}
{{dcl list end}}
+
{{dsc end}}
  
 
[[de:cpp/container/map]]
 
[[de:cpp/container/map]]

Revision as of 18:40, 31 May 2013

 
 
 
 
Defined in header <map>
template<

    class Key,
    class T,
    class Compare = std::less<Key>,
    class Allocator = std::allocator<std::pair<const Key, T> >

> class map;

std::map is a sorted associative container that contains key-value pairs with unique keys. Keys are sorted by using the comparison function Compare. Search, removal, and insertion operations have logarithmic complexity. Maps are usually implemented as red-black trees.

std::map meets the requirements of Template:concept, Template:concept, Template:concept and Template:concept.

Contents

Member types

Template:cpp/container/dcl list key typeTemplate:cpp/container/dcl list mapped typeTemplate:cpp/container/dcl list value typeTemplate:cpp/container/dcl list size typeTemplate:cpp/container/dcl list difference typeTemplate:cpp/container/dcl list key compareTemplate:cpp/container/dcl list allocator typeTemplate:cpp/container/dcl list referenceTemplate:cpp/container/dcl list const referenceTemplate:cpp/container/dcl list pointerTemplate:cpp/container/dcl list const pointerTemplate:cpp/container/dcl list iteratorTemplate:cpp/container/dcl list const iteratorTemplate:cpp/container/dcl list reverse iteratorTemplate:cpp/container/dcl list const reverse iterator
Member type Definition

Member classes

Template:cpp/container/dcl list value compare

Member functions

Template:cpp/container/dcl list constructorTemplate:cpp/container/dcl list destructorTemplate:cpp/container/dcl list operator=Template:cpp/container/dcl list get allocatorTemplate:cpp/container/dcl list atTemplate:cpp/container/dcl list operator atTemplate:cpp/container/dcl list beginTemplate:cpp/container/dcl list endTemplate:cpp/container/dcl list rbeginTemplate:cpp/container/dcl list rendTemplate:cpp/container/dcl list emptyTemplate:cpp/container/dcl list sizeTemplate:cpp/container/dcl list max sizeTemplate:cpp/container/dcl list clearTemplate:cpp/container/dcl list insertTemplate:cpp/container/dcl list emplaceTemplate:cpp/container/dcl list emplace hintTemplate:cpp/container/dcl list eraseTemplate:cpp/container/dcl list swapTemplate:cpp/container/dcl list countTemplate:cpp/container/dcl list findTemplate:cpp/container/dcl list equal rangeTemplate:cpp/container/dcl list lower boundTemplate:cpp/container/dcl list upper boundTemplate:cpp/container/dcl list key compTemplate:cpp/container/dcl list value comp
Element access
Iterators
Capacity
Modifiers
Lookup
Observers

Non-member functions

Template:cpp/container/dcl list operator cmpTemplate:cpp/container/dcl list swap2