I realize this is a contrived example, but I want a compile check to prevent this...
class A {}; class B : public A {}; class C : public A {}; class D : pub
The following should work:
BOOST_STATIC_ASSERT(((A*)(D*)0 == 0))
If A exists twice, this should rise an ambiguity error, while otherwise the test will always succeed (because it compares two null pointers).