typeid operator
Da cppreference.com.
![]() |
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
Informazioni query di tipo.
Original:
Queries information of a type.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Usato quando il tipo effettivo di una classe base virtuale deve essere noto.
Original:
Used where the actual type of a virtuale base class must be known.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Indice |
[modifica] Sintassi
typeid( type )
|
(1) | ||||||||
typeid( expression )
|
(2) | ||||||||
<typeinfo>
intestazione devono essere presenti prima di utilizzare l'operatore typeid
. Original:
Header
<typeinfo>
must be included before using typeid
operator. The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Entrambe le versioni restituire un oggetto di tipo const std::type_info&.
Original:
Both versions return an object of type const std::type_info&.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[modifica] Spiegazione
1)restituisce le informazioni sul tipo di type. Il tipo sarà sicuramente noto in fase di compilazione e non appesantisce il runtime è causato.
2) Original:
returns the type information about the type. The type will be definitely known compile time and no runtime overhead is caused.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
espressione viene valutata e informazioni sul tipo corrispondente al valore risultante viene restituito. Se il expression è in una classe base virtuale, il tipo effettivo della classe viene interrogato in modo dinamico con un po 'di overhead. In caso contrario, il tipo effettivo è sicuramente noto in fase di compilazione e non appesantisce il runtime è causato.
Original:
expression is evaluated and type information corresponding to the resulting value is returned. If the expression is in a virtual base class, the actual type of the class is queried dynamically with some runtime overhead. Otherwise the actual type is definitely known compile time and no runtime overhead is caused.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[modifica] Parole chiave
[modifica] Esempio
This section is incomplete Reason: no example |