std::is_error_code_enum<std::io_errc>
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. |
Elemento definito nell'header <ios> | ||
template<> struct is_error_code_enum<std::io_errc>:publicstd::true_type{}; | (dal C++11) | |
Questa specializzazione di componenti di libreria std::is_error_code_enum informa gli altri che i valori di tipo std::io_errc sono enumerazioni che contengono i codici di errore, che li rende convertibile in modo implicito e assegnabili a oggetti di tipo std::error_code.
Original:
This specialization of std::is_error_code_enum informs other library components that values of type std::io_errc are enumerations that hold error codes, which makes them implicitly convertible and assignable to objects of type std::error_code.
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.
Indice |
Inherited from std::integral_constant
Member constants
value [statico] | true (pubblico membro statico costante) |
Member functions
operator bool | converte l'oggetto in bool, restituisce value Original: converts the object to bool, returns value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) |
Member types
Tipo Original: Type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | Definition |
value_type | bool |
type | std::integral_constant<bool, value> |
[modifica]Esempio
Il confronto tra e.code() e std::io_errc::stream compila perché std::is_error_code_enum<std::io_errc>::value==true
Original:
The comparison between e.code() and std::io_errc::stream compiles because std::is_error_code_enum<std::io_errc>::value==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.
#include <iostream>#include <fstream>int main(){std::ifstream f("doesn't exist");try{ f.exceptions(f.failbit);}catch(conststd::ios_base::failure& e){std::cout<<"Caught an ios_base::failure.\n";if(e.code()==std::io_errc::stream)std::cout<<"The error code is std::io_errc::stream\n";}}
Output:
Caught an ios_base::failure. The error code is std::io_errc::stream
[modifica]Vedi anche
(C++11) | identifica una classe come codice_errore enumerazione Original: identifies a class as an error_code enumeration The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
(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) | il flusso IO codici di errore Original: the IO stream error codes The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (enum) |