/GR (Enable Run-Time Type Information)
Adds code to check object types at run time.
Syntax
/GR[-]
Remarks
When /GR is on, the compiler defines the _CPPRTTI
preprocessor macro. By default, /GR is on. /GR- disables run-time type information.
Use /GR if the compiler cannot statically resolve an object type in your code. You usually need the /GR option when your code uses dynamic_cast Operator or typeid. However, /GR increases the size of the .rdata sections of your image. If your code does not use dynamic_cast
or typeid
, /GR- may produce a smaller image.
For more information about 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 Set C++ compiler and build properties in Visual Studio.
Select the Configuration Properties > C/C++ > Language property page.
Modify the Enable Run-Time Type Info property.
To set this compiler option programmatically
- See RuntimeTypeInfo.
See also
Σχόλια
https://aka.ms/ContentUserFeedback.
Σύντομα διαθέσιμα: Καθ' όλη τη διάρκεια του 2024 θα καταργήσουμε σταδιακά τα ζητήματα GitHub ως μηχανισμό ανάδρασης για το περιεχόμενο και θα το αντικαταστήσουμε με ένα νέο σύστημα ανάδρασης. Για περισσότερες πληροφορίες, ανατρέξτε στο θέμα:Υποβολή και προβολή σχολίων για