vendredi 20 juillet 2018

What is the advantage of a pair C++ swap method?

Given,

auto a = make_pair(1,"one");
auto b = make_pair(2,"two");
a.swap(b);

When do I really need to use a.swap(b) when there is a more generalized std::swap(a,b) that works the same way.

Aucun commentaire:

Enregistrer un commentaire