以下のコードは有効な C++98 ですか、それとも新しいバージョンの C++ 標準が必要ですか?
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());
}
どうやら、私のコンパイラ (EDG フロント エンドに基づいていると思います) は、basic::f の using 宣言の後、user::f を考慮しません。C++98 によると、これは正しい動作ですか?