What are some good explanations on what argument dependent lookup is? Many people also call it Koenig Lookup as well.
Preferably I\'d like to know:
In Koenig Lookup, if a function is called without specifying its namespace, then the name of a function is also searched in namespace(s) in which the type of the argument(s) is defined. That is why it is also known as Argument-Dependent name Lookup, in short simply ADL.
It is because of Koenig Lookup, we can write this:
std::cout << "Hello World!" << "\n";
Otherwise, we would have to write:
std::operator<<(std::operator<<(std::cout, "Hello World!"), "\n");
which really is too much typing and the code looks really ugly!
In other words, in the absence of Koenig Lookup, even a Hello World program looks complicated.