Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
将 std::vector 分配给 std::multiset 有什么好的方法吗?当然除了迭代。我看到在 C++11 中有类似初始化列表的东西,也许它可以以某种方式使用?
vector<int> v; //fill your vector multiset<int> m (v.begin(), v.end());
用这个:
std::vector<SOME_TYPE> a; .... std::multiset<SOME_TYPE> ms(a.begin(), a.end());