I always thought that calling a function in a namespace requires either a using declaration, or a fully qualified name.
This code, however, compiles fine. It appears that the parameter from the namespace does the magic. Can anyone explain why this exception from the rule?
#include <iostream>
namespace A {
class B {};
void f(const B&)
{
std::cout << "f\n";
}
} // A
int main(int argc, char* argv[])
{
A::B b;
f(b);
return 0;
}