I watched Walter Brown\'s talk at Cppcon14 about modern template programming (Part I, Part II) where he presented his void_t
SFINAE technique.
Example:<
// specialized as has_member< T , void > or discarded (sfinae)
template
struct has_member> : true_type
{ };
That above specialization exists only when it is well formed, so when decltype( T::member )
is valid and not ambiguous.
the specialization is so for has_member
as state in the comment.
When you write has_member
, it is has_member
because of default template argument.
And we have specialization for has_member
(so inherit from true_type
) but we don't have specialization for has_member
(so we use the default definition : inherit from false_type
)