When I program in C++, instead of writing using namespace std;
, I generally tend to use std::
prefixed components like std::cout
, std::cin
etc. But then I came across ADL and why you should use using std::swap;
.
Many components of the standard library (within std) call swap in an unqualified manner to allow custom overloads for non-fundamental types to be called instead of this generic version: Custom overloads of swap declared in the same namespace as the type for which they are provided get selected through argument-dependent lookup over this generic version.
But in all sources about ADL, they only mention std::swap
. Are there any other functions like this that I have to be beware of when using? Or for all other functions should I use fully qualified name? Or should I use unqualified name for every function in std::
?
EDIT: (I wasn't clear when phrasing my initial question. Here is what I exactly intended when I was writing the question.)
Is there any other function in C++ standard libraries that is a popular candidate for ADL based customization much like std::swap
, so that when I use them, I have to be cautious to use using std::foo; foo();
form instead of invoking std::foo();
directly?