SFINAE not happening with std::underlying_type
问题 Below SFINAE code with variadic templates compiles nicely using clang 3.7.1, C++14: #include <array> #include <iostream> #include <vector> #include <cstdint> enum class Bar : uint8_t { ay, bee, see }; struct S { static void foo() {} // std::begin(h) is defined for h of type H template<typename H, typename... T> static typename std::enable_if<std::is_pointer<decltype(std::begin(std::declval<H>()))*>::value>::type foo(const H&, T&&... t) { std::cout << "container\n"; foo(std::forward<T>(t)...);