RTTI
This component allows users to enable or disable Run-Time Type Information for C++ source files within a library.
IMPORTANT
This component is only supported under GCC, Clang, and MSVC for C++.
Interactions
This component can interact with the Exceptions
component in a surprising way. If RTTI is disabled, and Exceptions are enabled, runtime type information is still generated for exceptions. This is a necessary requirement by many compilers. To ensure that your project does not generate any runtime type information, it is recommended to disable both RTTI and Exceptions.
Targets
Dialects::RTTI::Off
- Turns RTTI code generation (including language features, such as
typeid
anddynamic_cast
) on for a dependency. - Compilers will typically generate an error if language features requiring RTTI are encountered.
- If
Dialects::Exceptions::On
is set, runtime type information might still be generated due to C++ runtime implementation requirements. To ensure that your project does not generate any runtime type information in any situation, it is recommended to disable both RTTI and Exceptions. Dialects::RTTI::On
- Turns RTTI code generation (including language features, such as
typeid
anddynamic_cast
) on for a dependency. - If
Dialects::Exceptions::Off
is set,dynamic_cast<T&>
calls will most likely generate a compiler error.