std::system_error::system_error
Da cppreference.com.
< cpp | error | system error
![]() |
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. |
system_error( std::error_code ec ); |
(1) | (dal C++11) |
system_error( std::error_code ec, const std::string& what_arg ); |
(2) | (dal C++11) |
system_error( std::error_code ec, const char* what_arg ); |
(2) | (dal C++11) |
system_error( int ev, const std::error_category& ecat |
(3) | (dal C++11) |
system_error( int ev, const std::error_category& ecat, const std::string& what_arg); |
(4) | (dal C++11) |
system_error( int ev, const std::error_category& ecat, const char* what_arg); |
(4) | (dal C++11) |
Costruisce nuovo oggetto errore di sistema.
Original:
Constructs new system error object.
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.
1)
Costrutti con
ec
codice di erroreOriginal:
Constructs with error code
ec
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.
2)
Costrutti con
ec
codice di errore e la stringa what_arg
spiegazione. La stringa restituita da what()
è garantito per contenere what_arg
.Original:
Constructs with error code
ec
and explanation string what_arg
. The string returned by what()
is guaranteed to contain what_arg
.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.
3)
Costrutti con
ev
sottostante il codice di errore e la categoria di errore associato ecat
.Original:
Constructs with underlying error code
ev
and associated error category ecat
.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.
4)
Costrutti con
ev
sottostante il codice di errore, associato ecat
categoria di errore e what_arg
stringa esplicativa. La stringa restituita da what()
è garantito per contenere what_arg
.Original:
Constructs with underlying error code
ev
, associated error category ecat
and explanatory string what_arg
. The string returned by what()
is guaranteed to contain what_arg
.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] Parametri
ec | - | codice di errore
Original: error code The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
ev | - | codice di errore nella codifica di base
Original: error code in base encoding The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
ecat | - | la categoria di errore
Original: the category of error The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
what_arg | - | stringa esplicativa
Original: explanatory string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[modifica] Esempio
Viene illustrato come creare un'eccezione system_error da un valore errno
Original:
Demonstrates how to create a system_error exception from a errno value
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.
#include <iostream> #include <system_error> int main() { try { throw std::system_error(EDOM, std::system_category()); } catch (const std::system_error& error) { std::cout << "Error: " << error.code() << " - " << error.code().message() << '\n'; } }
Output:
Error: system:33 - Numerical argument out of domain