alternative to maps
Since maps dont allow duplicate values . Are there any other containers that are part of C++ standard library that allow du开发者_如何学编程plicates that store values by key value pair?
You can use std::multimap
Multimap is a Sorted Associative Container that associates objects of type Key with objects of type Data. multimap is a Pair Associative Container, meaning that its value type is pair. It is also a Multiple Associative Container, meaning that there is no limit on the number of elements with the same key.
精彩评论