I have a weird problem, and I wonder why g ++ 4.1.2 behaves the way it does.
The division is essentially:
#include <iostream> template<typename T> inline void f(T x) { std::cout << x*x; } namespace foo { class A { public: void f() const { f(2); } }; }
Calling f(2) not possible because the compiler does not match the template function f . I can make it work with ::f(2) , but I would like to know WHY it is necessary, since it is absolutely unambiguous, and as far as I know (admittedly outdated) knowledge about the rules of compliance, this should work.
source share