jeudi 28 mai 2015

Are tie'd objects copied when the tuple is used as a key in a map?

Suppose we have a map

using namespace std;
unordered_map<tuple<string,string>,string> map;

If I do

string a("a"), b("b");
map.emplace( std::tie(a,b), "c" );

are a and b actually copied, or does the map only keep their references as did the tuple produced with tie?

Aucun commentaire:

Enregistrer un commentaire