std::io_errc

std::io_errc (iostream 오류 코드)

I/O 스트림이 std::ios_base::failure 예외 객체에서 보고하는 오류 코드를 정의하는 스코프 열거 타입이에요. C++11부터 있어요.

출처: cppreference

본문

<ios> 헤더에 정의돼 있어요.

enum class io_errc {
    stream = 1,
};

스코프 열거 std::io_errcstd::ios_base::failure 예외 객체에서 I/O 스트림이 보고하는 오류 코드를 정의해요. std::io_errc::stream 하나만 요구되지만, 구현이 추가 오류 코드를 정의할 수 있어요. 적절한 std::is_error_code_enum 특수화가 제공되므로 std::io_errc 값은 std::error_code로 암시적으로 변환 가능해요.

멤버 상수

열거 상수
stream 1

비멤버 함수

std::error_code make_error_code( std::io_errc e ) noexcept;
std::error_condition make_error_condition( std::io_errc e ) noexcept;

std::io_errc 값을 std::error_code/std::error_condition으로 변환해요.

예제

#include <ios>
#include <system_error>
#include <iostream>

int main()
{
    std::error_code ec = std::io_errc::stream; // 암시적 변환
    std::cout << ec.value() << '\n'; // "1"
}

더 알아보기 (Learn more)

cppreference