According to the book I'm reading old style C casts are not recommended in C++. However, I've seen numerous examples of these casts in the Civilization 4 SDK. I would think that if their use was really discouraged then a program like Civ4 wouldn't use them, so is there any truth to this or is it just personal preference?



LinkBack URL
About LinkBacks




. You are perfectly correct though, a dynamic_cast has a performance penalty, but even on a perframe basis, in a game as simple as pong, I don't really thing this is a detail a new user should focus on. Readability/functionality first, performance later. I agree with you completely in regards to the fact that a failed cast in this case is not something you can really recover from. At that point, "It's dead Jim" and it is time to wind now. Actually, looking back in time, this would have been a very good time to introduce the concept of asserts!