How does using ellipses for SFINAE work?
问题 When using SFINAE to select constructor overloads in the past, I have typically used the following: template <typename T> class Class { public: template <typename U = T, typename std::enable_if<std::is_void<U>::value, int>::type=0> Class() { std::cout << "void" << std::endl; } template <typename U = T, typename std::enable_if<!std::is_void<U>::value, int>::type=0> Class() { std::cout << "not void" << std::endl; } }; However, I just came across this alternative: template <typename U = T,