Type trait to identify primary base class
问题 If I have a class Base, with at least one virtual function, and a class Derived which inherits singly from this then (uintptr_t)derived - (uintptr_t)static_cast<Base*>(derived) is guaranteed (by the Itanium ABI) to be zero, even though Derived is not standard layout. However in the general case this is not necessarily true (eg. multiple inheritance). Is it possible to write a trait which can be used to detect if one class is the primary base class of another? Useful sections from the Itanium