1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
// multimap::emplace_hint
#include <iostream>
#include <string>
#include <map>
int main ()
{
std::multimap<std::string,int> mymultimap;
auto it = mymultimap.end();
it = mymultimap.emplace_hint(it,"foo",10);
mymultimap.emplace_hint(it,"bar",20);
mymultimap.emplace_hint(mymultimap.end(),"foo",30);
std::cout << "mymultimap contains:";
for (auto& x: mymultimap)
std::cout << " [" << x.first << ':' << x.second << ']';
std::cout << '\n';
return 0;
}
|