Rule number two, you can safely use static_cast
to up cast in most cases (cannot think of one
case that won't work), and this does not use any run-time resources.
Rule number three, if you need to down cast, make the class hierarchy polymorphic, and use
dynamic_cast
with error (NULL
pointer) checking code.