Объединение статических утверждений с is_base_of<Base,Derived>
из Boost.TypeTraits:
BOOST_STATIC_ASSERT(boost::is_base_of<B, A>::value);
Наивная реализация (без учета целочисленных типов, частных базовых классов и неоднозначностей) может выглядеть следующим образом:
template<class B, class D>
struct is_base_of {
static yes test(const B&); // will be chosen if B is base of D
static no test(...); // will be chosen otherwise
static const D& helper();
static const bool value =
sizeof(test(helper())) == sizeof(yes);
// true if test(const B&) was chosen
};