In C++, a map is an STL associative container that holds a varying-length sequence of elements. The template class is std::map, and because this is a template class keys and values can be of any type. Elements in a map are ordered by the function Pred, which you can access via the key_comp() method. In a map, each key is unique.

Multimaps are just the same as maps, but they allow duplicate keys. They are created through use of the template class std::multimap.