"notme" <a@b.c> wrote in message news:3a*************@individual.net...
Hi everybody,
I'm working in a system that doesn't provide rtti functionality, so using
dynamic_cast is not
possible. I'm wondering how would be a better replacement: using static or
reintepret cast?
(Or something else?). This is to modify an existing program, so please
note that a redesign
is not possible.
I'm not sure what kind of "system" doesn't provide RTTI...? The
dynamic_cast can be used wherever you have a class hierarchy, to cast a
pointer (or reference) from one type to another type in the same hierarchy
tree (i.e., from a base* to a derived*, or the reverse). As far as I know,
any valid C++ compiler provides this ability.
Each of the casts is for a very specific purpose, and you simply can't just
choose to use a different one.
Perhaps a simple C-style cast would work? It's not preferred, and it's not
type-safe, but it works (in general).
In any case, without some idea of what you're trying to cast and why, it
would be hard for us to guess at a solution.
-Howard