1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
// multiset::emplace_hint
#include <iostream>
#include <set>
#include <string>
int main ()
{
std::multiset<std::string> mymultiset;
auto it = mymultiset.cbegin();
mymultiset.emplace_hint (it,"apple");
it = mymultiset.emplace_hint (mymultiset.cend(),"orange");
it = mymultiset.emplace_hint (it,"melon");
mymultiset.emplace_hint (it,"melon");
std::cout << "mymultiset contains:";
for (const std::string& x: mymultiset)
std::cout << ' ' << x;
std::cout << '\n';
return 0;
}
|