Is the code below valid C++98 or does it require a newer version of the C++ standard?
namespace basic
{
void f(int) {}
}
namespace lib
{
template<class T1, class T2>
void g(T1 x1, T2 x2)
{
using basic::f; // pull in function f for basic types without ADL
f(x1);
f(x2); // error: no suitable conversion function from "user::c" to "int" exists
}
}
namespace user
{
class c {};
void f(c) {}
}
int main()
{
lib::g(1, user::c());
}
Apparently, my compiler (based on EDG front end, I guess) does not consider user::f after the using declaration of basic::f. Is this correct behavior according to C++98?