Reputation: 1811
Is there any good way for assigning std::vector to std::multiset? Other than iteration of course. I see that in C++11 there is something like initializer list, maybe it can be used somehow?
Upvotes: 0
Views: 4486
Reputation: 16253
vector<int> v;
//fill your vector
multiset<int> m (v.begin(), v.end());
Upvotes: 14
Reputation: 70929
Use this:
std::vector<SOME_TYPE> a;
....
std::multiset<SOME_TYPE> ms(a.begin(), a.end());
Upvotes: 4