g++ and clang++ different behaviour with SFINAE and SFINAE failure
问题 A couple of questions for C++11 experts. I'm fighting with SFINAE and I came across a strange case in which g++ (4.9.2), and clang++ (3.5.0) behave differently. I have prepared the following sample code. I'm sorry but I'm unable to do it significantly more concise. #include <string> #include <iostream> #include <typeinfo> #include <type_traits> template <typename X> class foo { private: template <typename R> using enableIfIsInt = typename std::enable_if<std::is_same<X, int>::value, R>::type;