Sure it makes sense, if it makes sense in your program.
The Standard doesn't mind if you have a multimap
with duplicate values:
23.3.2 Class template multimap
1/A multimap is a kind of associative container that supports
equivalent keys (possibly containing multiple copies of the same key
value) and provides for fast retrieval of values of another type T
based on the keys.
The multimap class supports bidirectional iterators.
So the question isn't if this makes sense from a language perspective -- the question is does it make sense in terms of what you are trying to do?
Off the top of my head I can see this making sense if you want a count of the number of items of a particular value associated with a single key. Perhaps each value might compare equal and still have different attributes (ex: student roster where equality is determined based on name. Foolish, perhaps, but possible.)
It occurs to me that there is at least some similarity between a map with duplicate values and a hash map. There are some obvious differences as well, least of which being domain applicability, but enough similarity to make me think if you are considering having a multimap
with duplicate values, you might actually need a hash map (unordered_map
in C++11).