Intermediate
C++
Q76 / 100
What is SFINAE and how does std::void_t simplify it?
Correct! Well done.
Incorrect.
The correct answer is B) std::void_t<expr> evaluates to void when expr is valid, enabling cleaner SFINAE type traits without complex helper specializations
B
Correct Answer
std::void_t<expr> evaluates to void when expr is valid, enabling cleaner SFINAE type traits without complex helper specializations
Explanation
template<class T, class = void> struct has_size : false_type {}; template<class T> struct has_size<T, void_t<decltype(T::size)>> : true_type {} detects if T has ::size.
Progress
76/100