mardi 29 décembre 2015

Is std::swap guaranteed to find nonmember swap by ADL?

A textbook by Torsten T. Will on C++11 says that since C++11, std::swap will use a nonmember swap found by ADL if such a nonmember function is defined, thus the pattern

using std::swap;
swap (obj1, obj2);

can always be replaced by a simple

std::swap (obj1, obj2);

Unfortunately, I did not find such a statement anywhere else.

What is the truth?

Aucun commentaire:

Enregistrer un commentaire