Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC++template metaprogrammingSingle-choice MCQ

In a template metaprogram, what is the key reason this `void_t`-based detection idiom correctly reports 'no member' for types lacking `::type`, rather than producing a hard compile error?

template <class, class = void> struct has_type : std::false_type {}; template <class T> struct has_type<T, std::void_t<typename T::type>> : std::true_type {};