/GR (Enable Run-Time Type Information)
Adds code to check object types at run time.
/GR[-]
Remarks
When /GR is on, the compiler defines the _CPPRTTI preprocessor macro. In Visual C++ 2005, /GR is on by default. /GR- disables run-time type information.
Use /GR if your code uses dynamic_cast Operator or typeid. /GR does, however, cause the .rdata sections of your image to increase in size. If your code does not use dynamic_cast or typeid, using /GR- may produce a smaller image.
For more information on run-time type checking, see Run-Time Type Information in the C++ Language Reference.
To set this compiler option in the Visual Studio development environment
Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.
Click the C/C++ folder.
Click the Language property page.
Modify the Enable Run-Time Type Info property.
To set this compiler option programmatically
- See RuntimeTypeInfo.