问题 I am using function SFINAE heavily in a project and am not sure if there are any differences between the following two approaches (other than style): #include <cstdlib> #include <type_traits> #include <iostream> template <class T, class = std::enable_if_t<std::is_same_v<T, int>>> void foo() { std::cout << "method 1" << std::endl; } template <class T, std::enable_if_t<std::is_same_v<T, double>>* = 0> void foo() { std::cout << "method 2" << std::endl; } int main() { foo<int>(); foo<double>();