Espacios de nombres
Variantes
Acciones

cpp/io/basic ios/exceptions

De cppreference.com
< cpp‎ | io‎ | basic ios
std::ios_base::iostate exceptions() const;
void exceptions(std::ios_base::iostate except);

[editar] Parámetros

except -
excepción máscara
Original:
exception mask
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Ejemplo

#include <iostream>
#include <fstream>
 
int main() {
    int ivalue;
    try {
        std::ifstream in("in.txt");
        in.exceptions(std::ifstream::failbit);
        in >> ivalue;
    } catch (std::ios_base::failure &fail) {
        // handle exception here
    }
}