RE: [boost] Checking if RTTI is available.

From: Jurko Gospodnetiæ [mailto:jurko@zse.hr] Sent: September 2, 2004 04:14
Hi all.
I was wondering if boost has any portable way for detecting whether RTTI is enabled? (For instance a macro expanding to _CPPRTTI in Visual Studio). If there is, I have not been able to find it.
Out of curiosity: why would anybody not use RTTI ? Why shouldn't compilers without RTTI just considered broken ? Being able to switch RTTI support off just introduces binary incompatibilities and makes some code illegal (you can't cast between classes with a virtual inheritance relationship without dynamic_cast, etc.) Regards, Stefan

Stefan Seefeld wrote:
From: Jurko Gospodnetiæ [mailto:jurko@zse.hr] Sent: September 2, 2004 04:14
Hi all.
I was wondering if boost has any portable way for detecting whether RTTI is enabled? (For instance a macro expanding to _CPPRTTI in Visual Studio). If there is, I have not been able to find it.
Out of curiosity: why would anybody not use RTTI ? Why shouldn't compilers without RTTI just considered broken ?
`-fno-rtti' Disable generation of information about every class with virtual functions for use by the C++ runtime type identification features (`dynamic_cast' and `typeid'). If you don't use those parts of the language, you can save some space by using this flag. Note that exception handling uses the same information, but it will generate it as needed.
participants (2)
-
Neal D. Becker
-
Stefan Seefeld