The multimap associative container is used for fast storage and retrieval of keys and associated values (often called key–value pairs). Many of the functions used with
sets are also used with
maps. The elements of
pairs of keys and values instead of individual values. When inserting into a
pair object that contains the key and the value is used. The ordering of the keys is determined by a comparator function object. For example, in a
multimap that uses integers as the key type, keys can be sorted in ascending order by ordering them with comparator function object
less<int>. Duplicate keys are allowed in a
multimap, so multiple values can ...