Error handling
Da cppreference.com.
< cpp
![]() |
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. |
[modifica] Gestione delle eccezioni
Il
<exception>
intestazione fornisce diverse classi e le funzioni relative alla gestione delle eccezioni in 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.
Definizione nell'header
<exception> | |
classe base per le eccezioni generate dai componenti della libreria 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. | |
controlla se la gestione delle eccezioni è attualmente in corso 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. (funzione) | |
(C++11) |
puntatore di tipo comune per la gestione di oggetti eccezione 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) |
crea un std::exception_ptr da un oggetto eccezione 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. (funzione di modello) |
(C++11) |
captures the current exception in a std::exception_ptr (funzione) |
(C++11) |
genera l'eccezione da 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. (funzione) |
(C++11) |
un tipo mixin per acquisire e memorizzare le eccezioni attuali 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) |
lancia la sua tesi con std::nested_exception misto trovi 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. (funzione di modello) |
(C++11) |
genera l'eccezione di 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. (funzione di modello) |
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. | |
funzione chiamata quando la gestione delle eccezioni non riesce 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. (funzione) | |
il tipo di funzione chiamata da 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) |
ottiene il terminate_handler corrente 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. (funzione) |
cambia la funzione di essere chiamato da 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. (funzione) | |
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. | |
(deprecato) |
funzione chiamata quando specifica eccezione dinamica è violata 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. (funzione) |
Eccezione generata quando specifica eccezione dinamica è violato, se possibile 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) | |
(deprecato) |
il tipo di funzione chiamata da 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)(deprecato) |
ottiene il unexpected_handler corrente 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. (funzione) |
(deprecato) |
cambia la funzione di essere chiamato da 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. (funzione) |
[modifica] Eccezione categorie
Diverse classi di convenienza sono predefiniti nel
<stdexcept>
intestazione per segnalare condizioni di errore particolari. Queste classi possono essere suddivisi in due categorie: logica errori e gli errori di runtime. Gli errori logici sono la conseguenza di una logica errata all'interno del programma e possono essere prevenute. Gli errori di runtime sono dovuti ad eventi al di là del campo di applicazione del programma e non può essere facilmente prevedibile.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.
Definizione nell'header
<stdexcept> | |
classe di eccezione per indicare le violazioni dei presupposti logici o invarianti di 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) | |
eccezione di classe per segnalare argomenti non validi 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) | |
eccezione di classe per segnalare errori di dominio 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 di eccezione per segnalare tentativi di superare le dimensioni massime consentite 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 di eccezione per segnalare argomenti al di fuori del campo previsto 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 di eccezione per indicare le condizioni rilevabili solo in fase di esecuzione 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 di eccezione per segnalare errori di intervallo in calcoli interni 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) | |
eccezione di classe per segnalare overflow aritmetici 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) | |
eccezione di classe per segnalare underflow aritmetici 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) |
[modifica] Errore numeri
Definizione nell'header
<cerrno> | |
macro che si espande a POSIX thread locale variable
(variabili macro) Numero di errore Original: macro which expands to POSIX-compatible thread-local error number variable (variabili macro) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
macro per standard POSIX compatibili con le condizioni di errore 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. (macro costante) |
[modifica] Asserzioni
Asserzioni contribuire ad attuare il controllo dei presupposti ai programmi.
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.
affermazione statico | esegue in fase di compilazione affermazione controllo (dal C++11)
Original: performs compile-time assertion checking (dal C++11) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definizione nell'header
<cassert> | |
interrompe il programma se la condizione specificata dall'utente non è true. Può essere disattivato per build di rilascio 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. (funzione macro) |
[modifica] Errore di sistema
L'intestazione definisce
<system_error>
tipi e funzioni utilizzate per segnalare condizioni di errore provenienti dal sistema operativo, flussi di I / O, std::future, o altra API di basso livello.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.
Definizione nell'header
<system_error> | |
(C++11) |
classe di base per le categorie di errore 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) |
identifica la categoria di errore generico 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. (funzione) |
(C++11) |
identifica la categoria di errore del sistema operativo 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. (funzione) |
(C++11) |
contiene un codice di errore portatile 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'enumerazione std::error_condition elenco di tutti gli standard <cerrno> costanti 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) |
in possesso di un dipendente dalla piattaforma codice di errore 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 di eccezione utilizzato per segnalare le condizioni che hanno un codice_errore 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) |