Don't assume that RTTI will have more/less overhead than your solution before testing it.
You should try both solutions and measure the performances to get a reliable answer.
I actually asked myself the same question a few years ago and I ended up adding a member variable to "fasten" the type testing, just like you did. Turned out my code was needlessly cluttered with stupid tests while some dynamic_cast<>
would have done the same job (in fact, a better job).
I refactored the code to use dynamic_cast<>
since then and I wouldn't go back.
As a foot-note: if your classes are polymorphic, you already "paid" for this anyway, so just go with dynamic_cast<>
.