我希望编译时没有错误。只是想让它等到实例化
template<class T>
struct A : public T{
void f(){ foo(); }
};
int main() {}
最佳答案
您可以将代码更改为:
template<class T>
struct A : public T{
void f(){ this->foo(); } // or T::foo();
};
int main() {}
使 foo
类型依赖以修复您的代码。
关于c++ - 如何让Clang改变两阶段查找的规则?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56475513/