Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC++SFINAE and enable_ifSingle-choice MCQ

What is wrong with trying to overload a single function template using enable_if on the same default template argument value, like this?

template <class T, typename = std::enable_if_t<std::is_integral_v<T>>> void g(T) {} template <class T, typename = std::enable_if_t<std::is_floating_point_v<T>>> void g(T) {}