Interfaces
Within C++, functions found by ADL are considered part of a class's interface. Within the Standard Template Library, several algorithms make use of unqualified calls to swap from within the std namespace. As a result, the generic std::swap function is used if nothing else is found, but if these algorithms are used with a third-party class, Foo, found in another namespace that also contains swap(Foo&, Foo&), that overload of swap will be used.
Read more about this topic: Argument-dependent Name Lookup
Related Phrases
Related Words