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

Why do these two overloads form a valid SFINAE pair rather than redefinition error?

template <class T, std::enable_if_t<std::is_integral_v<T>, int> = 0> void f(T) { /* integral */ } template <class T, std::enable_if_t<std::is_floating_point_v<T>, int> = 0> void f(T) { /* floating */ }