Noeud:Multimap, Noeud « Previous »:Map, Noeud « Up »:Containers and Iterators



Multimap

As multiset is similar to set except that it allows duplicate elements, multimap is similar to map except that it allows for duplicate keys. Like multiset (Multiset), accessing ranges of pair objects is done by using lower_bound and upper_bound. The search operations available for set are also available to multimap, so we'll not look at them here because the interface is exactly the same. Just be aware that since you'd do a search on (for example) lower_bound(key), that you'll have to get the key from the pair object representing the multimaps element using the first member of pair. Like map, you use a multimap in your code by including <map>.