任何人都可以解释这个
"A using-declaration in a derived class cannot refer to a specialization
of a template conversion function in a base class."
Run Code Online (Sandbox Code Playgroud)
它来自ISO C++标准.14.5.2,第7点
这意味着这是不正确的:
struct A { template<typename T> operator T(); };
struct B : A { using A::operator int; }; // ill-formed: refers to specialization
Run Code Online (Sandbox Code Playgroud)
同样适用于其他功能模板专业化(不仅仅是转换功能)
struct A { template<typename T> void f(); };
struct B : A { using A::f<int>; }; // ill-formed: refers to specialization
Run Code Online (Sandbox Code Playgroud)