3
Demo是否可以在模板成员函数上进行out-of-line sfinae?
A :: foo的类声明。
struct A {
template <typename T>
void foo(T a);
};
A :: foo现在被sfinae分割。
template <typename T>
typename std::enable_if<(sizeof(T) > 4), void>::type A::foo(T a) {
std::cout << "> 4 \n";
}
这是行不通的。这是不允许的?
怎么样把启用如果函数参数? – themagicalyang
@themagicalyang当然,同样的区别。 – Potatoswatter