|
 |
Nicolas Alvarez wrote:
> I think the most useful feature of RTTI is not typeid() to get a string, but
> dynamic_cast.
Yeah, but I've never seen an OO language that lacks that feature. :-)
Singling it out as something with a special name seems odd to me. I guess
the C++ standards authors just like making up their own names for things. It
would be like saying "Our language supports class-based OOP *and* virtual
functions!"
Don't things like GCC support dynamic_cast and virtual functions this even
if you compile without the switch that enables typeid? (Or with the switch
that turns it off? I seem to be finding conflicting info, altho I might be
looking at different compilers.)
It seems strange, too, that it would add any overhead at all, except maybe
one word of pointer to each class's code, to point to the type_info object.
Don't you need vtable pointers even if "RTTI" is turned off?
--
Darren New, San Diego CA, USA (PST)
My fortune cookie said, "You will soon be
unable to read this, even at arm's length."
Post a reply to this message
|
 |