Populate a vector with all multimap values with a given key

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2010-04-02T17:43:13Z Indexed on 2010/04/02 17:53 UTC
Read the original article Hit count: 178

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about c++

Related posts about stl