What does it mean when one says something is SFINAE-friendly?
问题 I can't clearly get the grasp of what it means when one mentions that a particular function, struct or ... is SFINAE-friendly . Would someone please explain it? 回答1: When it allows substitution failure without hard error (as static_assert ). for example template <typename T> void call_f(const T& t) { t.f(); } The function is declared for all T , even those with don't have f , so you cannot do SFINAE on call_f<WithoutF> as the method does exist. (Demo of non compiling code). With following