
Safely Downcast Pointers Without dynamic_cast Overhead
Suppose you have a class hierarchy and you plan to do some downcasts. Try writing virtuals in the root class to do the downcasting to NULL for each of the subclasses. Then, write each subclass so it downcasts to itself statically. I run Debian and gcc 3.4.3 on a modern