noexcept operator (depuis C++11)
De cppreference.com
[] |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
L'oprateur
noexcept effectue une vrification de compilation qui renvoie vrai si l'expression est dclar ne pas jeter des exceptions .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.
Il peut tre utilis dans un modle de fonction
noexcept spcificateur
de dclarer que la fonction lever des exceptions pour certains types mais pas d'autres .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 spcificateur
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.
Syntaxe
noexcept( expression )
|
|||||||||
Retourne un objet de type ..
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.
Explication
L'oprateur
noexcept ne expression valuer. Le rsultat est false si le expression contient au moins une des constructions suivantes potentiellement valus: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.
- appeler tout type de fonction qui n'a pas de spcification d'exception non lancer, sauf si c'est unexpression constante.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 aexpression constante.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. throwexpressionOriginal:throwexpressionThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.dynamic_castexpression lorsque la conversion a besoin d'une vrification de l'excutionOriginal: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.typeidexpression lorsque le type d'argument est de type classe polymorpheOriginal: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.
Dans tous les autres cas, le rsultat est
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.
Mots-cls
Exemple
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;
}
Voir aussi
| noexcept spcificateur | ncessite une fonction ne pas jeter tout (C++11) exceptions
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. |
| spcification d'exception | spcifie les exceptions sont jets par un (obsolte) fonction
Original: specifies what exceptions are thrown by a function (obsolte) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |