The motivation for my question was that I have read that using RTTI is inherently slow. I haven't done actual runtine comparisons, though; runtime may be compiler dependent anyway. The alternate solution I came up with was to make each derived class have a static member containing an enum, and then comparing derived classes just boils down to (this->type == derived->type). Rather non-OOP.
The application is that I am parsing a grammar into a tree, where the nodes represent various types of operations and atoms. The nodes are equal only if they are the same type and have the same value.