Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

alternative to maps

Tags:

c++

Since maps dont allow duplicate values . Are there any other containers that are part of C++ standard library that allow duplicates that store values by key value pair?

like image 402
brett Avatar asked Jul 06 '10 23:07

brett


People also ask

Does Google Maps have better alternatives?

The good news is that there are so many apps to choose from if you're seeking alternatives to Google Maps, so you'll be sure to find one that suits your needs. Google Maps and Waze are the most popular, but Apple Maps is very easy to use and reliable, too.


1 Answers

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.

like image 187
Brian R. Bondy Avatar answered Oct 17 '22 23:10

Brian R. Bondy