![cs cz maps cs cz maps](https://static2.cs-bg.net/maps/images/screenshots/mapscz/misc/cz-172-auto_special_jam_cz.jpg)
Associative containers are optimized for the operations of lookup, insertion, and removal. The choice of container type should be based in general on the type of searching and inserting required by the application. This is a minimal set of functionality, but it is enough to be able to talk meaningfully about a range of iterators [First, Last) in the context of the class's member functions. It may be assumed that an input iterator may be dereferenced to refer to some object and that it may be incremented to the next iterator in the sequence. Each iterator concept has its own set of requirements and the algorithms that work with them must limit their assumptions to the requirements provided by that type of iterator. The different iterator concepts form a family related by refinements in their functionality. The iterator provided by the map class is a bidirectional iterator, but the class member functions insert and multimap have versions that take as template parameters a weaker input iterator, whose functionality requirements are more minimal than those guaranteed by the class of bidirectional iterators. The data types to be used for elements and keys are, instead, specified as parameters in the class template along with the comparison function and allocator. Multiple, because its elements don't need to have a unique key, so that one key value may have many element data values associated with it.Ī pair associative container, because its element data values are distinct from its key values.Ī class template, because the functionality it provides is generic and so independent of the specific type of data contained as elements or keys. Sorted, because its elements are ordered by key values within the container in accordance with a specified comparison function.
![cs cz maps cs cz maps](https://static.wikia.nocookie.net/cswikia/images/9/9d/CSCZ_new_interface_elements.png)
Reversible, because it provides bidirectional iterators to access its elements. The C++ Standard Library multimap class isĪn associative container, which a variable size container that supports the efficient retrieval of element values based on an associated key value. This argument is optional and the default value is allocator >. The type that represents the stored allocator object that encapsulates details about the map's allocation and deallocation of memory. For more information, see Heterogeneous Lookup in Associative Containers In C++14 you can enable heterogeneous lookup by specifying the std::less or std::greater predicate that has no type parameters. The binary predicate less is the default value. The type that provides a function object that can compare two element values as sort keys to determine their relative order in the multimap. The element data type to be stored in the multimap. The key data type to be stored in the multimap. Instead, key values associated with old elements must be deleted and new key values associated with new elements inserted. The value of an element in a multimap, but not its associated key value, may be changed directly. The value of the key doesn't need to be unique and is used to order the data automatically. The C++ Standard Library multimap class is used for the storage and retrieval of data from a collection in which each element is a pair that has both a data value and a sort key.