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

Why does `is_complete<X>` below give wrong/unstable answers, illustrating a known pitfall of completeness-detection via SFINAE?

template <typename T, typename = void> struct is_complete : std::false_type {}; template <typename T> struct is_complete<T, std::void_t<decltype(sizeof(T))>> : std::true_type {};