I have a trait class that implements some interface depending on whether its template parameter type is defined or not:
template<class T, class=void>
struct traits {
// impl for undefined types
};
template<class T>
struct traits<T, decltype(void(sizeof(T)))> {
// impl for defined types
};
This works fine, however I get an error when the type is defined but has a member with incomplete type, for instance when passing an instance of some class template where the template parameter is itself undefined.
Therefore I would like to know if there exists some SFINAE-fu to detect defined types with incomplete fields.