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

Why does the SFINAE in this overload correctly disable it for non-integral types instead of producing a hard error?

template <typename T, typename = std::enable_if_t<std::is_integral_v<T>>> void f(T) { /* integral path */ } f(3.14); // double argument