I am trying to partially specialize a tag for non-character arrays:
template<typename T> struct is_container : std::false_type {}; template<typename T, unsigned N> struct is_container<T[N]> : std::enable_if<!std::is_same<T, char>::value, std::true_type>::type {};
Visual Studio 2010 gives me C2039 ( type not an enable_if element ...). However, shouldn't SFINAE be excluded here, and not give a compiler error? Or is SFINAE not applicable in this case?
Of course, I could just highlight specializations for non char and char:
template<typename T> struct is_container : std::false_type {}; template<typename T, unsigned N> struct is_container<T[N]> : std::true_type {}; template<unsigned N> struct is_container<char[N]> : std::false_type {};
But I really would like to know why SFINAE does not work in this particular case.
source share