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