Populate a vector with all multimap values with a given key
- by John
Given a multimap<A,B> M what's a neat way to create a vector<B> of all values in M with a specific key.
e.g given a multimap how can I get a vector of all strings mapped to the value 123?
An answer is easy, looping from lower-upper bound, but is there a neat loop-free method?