The code fragment can_derive_from<T>::value will be true if T is a class (but not a union), otherwise it will be false. Only classes which are not unions can be derived from.
bool b = can_derive_from<T>::value;