noexcept operator (dal C++11)
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. |
<metanoindex/>
L'operatore
noexcept esegue un controllo in fase di compilazione che restituisce true se l'espressione è dichiarato non gettare alcuna eccezione.Original:
The
noexcept operator performs a compile-time check that returns true if an expression is declared to not throw any exceptions.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.
Può essere utilizzato all'interno di un modello di
noexcept specificatore
funzione di dichiarare che la funzione genera eccezioni per alcuni ma non per altri tipi di.Original:
noexcept specifier
The text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
Original:
It can be used within a function template's
noexcept specificatore
to declare that the function will throw exceptions for some types but not others.Original:
noexcept specifier
The text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
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.
Sintassi
noexcept( expression )
|
|||||||||
Restituisce un oggetto di tipo
bool. Original:
Returns an object of type
bool. 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.
Spiegazione
L'operatore
noexcept non expression valutare. Il risultato è false se la expression contiene almeno uno dei seguenti costrutti potenzialmente valutati:Original:
The
noexcept operator does not evaluate expression. The result is false if the expression contains at least one of the following potentially evaluated constructs: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.
- chiamare a qualsiasi tipo di funzione che non sono non-lancio specifica eccezione, a meno che non si tratta di unun'espressione costante.Original:constant expressionThe text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.Original:call to any type of function that does not have non-throwing exception specification, unless it is aun'espressione costante.Original:constant expressionThe text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. throwespressioneOriginal:throwexpressionThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.dynamic_castespressione quando la conversione ha bisogno di un controllo di tempo di esecuzioneOriginal:dynamic_castexpression when the conversion needs a run time checkThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.typeidespressione quando il tipo di argomento è di tipo classe polimorficaOriginal:typeidexpression when argument type is polymorphic class typeThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
In tutti gli altri casi il risultato è
true.Original:
In all other cases the result is
true.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.
Parole chiave
Esempio
template <class T>
void self_assign(T& t) noexcept(noexcept(T::operator=))
{ // self_assign is noexcept if and only if T::operator= is noexcept
t = t;
}
Vedi anche
| noexcept specificatore | richiede una funzione di gettare alcun (C++11) eccezioni
Original: requires a function to not throw any exceptions (C++11) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| un'eccezione specifica | specifica quali eccezioni vengono generate da un (deprecato) funzione
Original: specifies what exceptions are thrown by a function (deprecato) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |