Error handling
De cppreference.com
< cpp
![]() |
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. |
[modifier] La gestion des exceptions
L'en-tête
<exception>
fournit plusieurs classes et fonctions liées à la gestion des exceptions dans les programmes C++ .Original:
The header
<exception>
provides several classes and functions related to exception handling in C++ programs.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.
Defined in header
<exception> | |
classe de base pour les exceptions levées par les composants de la bibliothèque standard Original: base class for exceptions thrown by the standard library components The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
Original: Capture and storage of exception objects The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
vérifie si la gestion des exceptions est actuellement en cours Original: checks if exception handling is currently in progress The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
(C++11) |
type de pointeur partagé pour manipuler des objets d'exception Original: shared pointer type for handling exception objects The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (typedef) |
(C++11) |
crée un std::exception_ptr à partir d'un objet d'exception Original: creates an std::exception_ptr from an exception object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction générique) |
(C++11) |
capture l'exception en cours dans un std::exception_ptr Original: captures the current exception in a std::exception_ptr The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) |
(C++11) |
lève l'exception d'un std::exception_ptr Original: throws the exception from an std::exception_ptr The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) |
(C++11) |
un type mixin pour capturer et stocker les exceptions actuelles Original: a mixin type to capture and store current exceptions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
(C++11) |
jette sa dispute avec std::nested_exception mixtes po Original: throws its argument with std::nested_exception mixed in The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction générique) |
(C++11) |
lève l'exception d'un std::nested_exception Original: throws the exception from a std::nested_exception The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction générique) |
Original: Handling of failures in exception handling The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
la fonction appelée lorsque la gestion des exceptions échoue Original: function called when exception handling fails The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
le type de la fonction appelée par std::terminate Original: the type of the function called by std::terminate The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (typedef) | |
(C++11) |
obtient la terminate_handler courant Original: obtains the current terminate_handler The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) |
changements de la fonction d'être appelé par std::terminate Original: changes the function to be called by std::terminate The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
Original: Handling of exception specification violations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
(obsolète) |
la fonction appelée lorsque spécification d'exception dynamique est violé Original: function called when dynamic exception specification is violated The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) |
Exception levée lorsque spécification d'exception dynamique est violée, si possible Original: exception thrown when dynamic exception specification is violated, if possible The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
(obsolète) |
le type de la fonction appelée par std::unexpected Original: the type of the function called by std::unexpected The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (typedef) |
(C++11) (obsolète) |
obtient la unexpected_handler courant Original: obtains the current unexpected_handler The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) |
(obsolète) |
changements de la fonction d'être appelé par std::unexpected Original: changes the function to be called by std::unexpected The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) |
[modifier] Catégories d'exception
Plusieurs classes de commodité sont prédéfinis dans l'entête
<stdexcept>
pour signaler des conditions d'erreur spécifiques. Ces classes peuvent être divisées en deux catégories: logique erreurs et erreurs exécution. Les erreurs de logique sont une conséquence de la logique défectueuse dans le programme et pourraient être évitées. Les erreurs d'exécution sont dus à des événements indépendants de la portée du programme et ne peuvent pas être facilement prédites .Original:
Several convenience classes are predefined in the header
<stdexcept>
to report particular error conditions. These classes can be divided into two categories: logic errors and runtime errors. Logic errors are a consequence of faulty logic within the program and may be preventable. Runtime errors are due to events beyond the scope of the program and can not be easily predicted.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.
Defined in header
<stdexcept> | |
classe d'exception pour indiquer les violations des conditions logiques ou les invariants de classe Original: exception class to indicate violations of logical preconditions or class invariants The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
classe d'exception à signaler arguments non valides Original: exception class to report invalid arguments The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
classe d'exception pour signaler les erreurs de domaine Original: exception class to report domain errors The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
classe d'exception à signaler les tentatives pour dépasser la taille maximale autorisée Original: exception class to report attempts to exceed maximum allowed size The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
classe d'exception à signaler arguments en dehors de la plage attendue Original: exception class to report arguments outside of expected range The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
classe d'exception pour indiquer que les conditions détectables au moment de l'exécution Original: exception class to indicate conditions only detectable at run time The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
classe d'exception pour signaler les erreurs dans les calculs internes gamme Original: exception class to report range errors in internal computations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
classe d'exception à signaler les débordements arithmétiques Original: exception class to report arithmetic overflows The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
classe d'exception à signaler sousverses arithmétiques Original: exception class to report arithmetic underflows The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
[modifier] Les numéros d'erreur
Defined in header
<cerrno> | |
macro qui se développe pour compatible POSIX thread local variable
( variable de macro ) numéro d'erreur Original: macro variable The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. Original: macro which expands to POSIX-compatible thread-local error number variable ( variable de macro ) Original: macro variable The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click 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. | |
macros pour des conditions standard d'erreur compatible POSIX Original: macros for standard POSIX-compatible error conditions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante macro) |
[modifier] Les assertions
Assertions aider à mettre en œuvre la vérification des conditions préalables à des programmes .
Original:
Assertions help to implement checking of preconditions in programs.
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.
l'affirmation statique | effectue la compilation affirmation de vérifier (depuis C++11)
Original: performs compile-time assertion checking (depuis C++11) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Defined in header
<cassert> | |
arrête le programme si la condition spécifiée par l'utilisateur n'est pas true. Peut être désactivé pour les versions release Original: aborts the program if the user-specified condition is not true. May be disabled for release builds The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction macro) |
[modifier] Erreur du système
L'en-tête
<system_error>
définit les types et les fonctions utilisées pour signaler des conditions d'erreur en provenance du système d'exploitation, les flux d'entrée / sortie, std::future, ou autre API de bas niveau .Original:
The header
<system_error>
defines types and functions used to report error conditions originating from the operating system, streams I/O, std::future, or other low-level APIs.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.
Defined in header
<system_error> | |
(C++11) |
classe de base pour les catégories d'erreur Original: base class for error categories The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
(C++11) |
identifie la catégorie d'erreur générique Original: identifies the generic error category The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) |
(C++11) |
identifie la catégorie d'erreur du système d'exploitation Original: identifies the operating system error category The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) |
(C++11) |
détient un code d'erreur portable Original: holds a portable error code The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
(C++11) |
l'énumération std::error_condition liste de tous les standards <cerrno> constantes macroOriginal: the std::error_condition enumeration listing all standard <cerrno> macro constantsThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
(C++11) |
détient un code d'erreur dépendant de la plate-forme Original: holds a platform-dependent error code The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
(C++11) |
classe d'exception utilisée pour signaler des conditions qui ont une error_code Original: exception class used to report conditions that have an error_code The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |