# std::errc

< cpp‎ | error

C++
 言語 ヘッダ 名前付き要件 言語サポートライブラリ コンセプトライブラリ (C++20) 診断ライブラリ ユーティリティライブラリ 文字列ライブラリ コンテナライブラリ アルゴリズムライブラリ イテレータライブラリ 数値演算ライブラリ 入出力ライブラリ ローカライゼーションライブラリ 正規表現ライブラリ (C++11) アトミック操作ライブラリ (C++11) スレッドサポートライブラリ (C++11) ファイルシステムライブラリ (C++17) 技術仕様書

ユーティリティライブラリ

エラー処理
プログラムユーティリティ

(C++11)

 pair tuple(C++11) apply(C++17) make_from_tuple(C++17)
 optional(C++17) any(C++17) variant(C++17)

(C++14)
(C++11)
(C++11)

(C++17)
(C++17)

(C++11)
(C++17)

エラー処理
 例外処理 exception exception_ptr(C++11) make_exception_ptr(C++11) current_exception(C++11) rethrow_exception(C++11) nested_exception(C++11) throw_with_nested(C++11) rethrow_if_nested(C++11) 例外処理の失敗 terminate terminate_handler get_terminate(C++11) set_terminate bad_exception unexpected(C++17以前) unexpected_handler(C++17以前) get_unexpected(C++11)(C++17以前) set_unexpected(C++17以前)
 例外のカテゴリ logic_error invalid_argument domain_error length_error out_of_range runtime_error range_error overflow_error underflow_error tx_exception(TM TS) エラーコード エラーコード errno アサーション assert system_error error_category(C++11) generic_category(C++11) system_category(C++11) error_condition(C++11) errc(C++11) error_code(C++11) system_error(C++11)

 ヘッダ  で定義 enum class errc; (C++11およびそれ以降)
スコープの列挙std::errcはPOSIXのエラーコードに対応するポータブルエラー条件の値を定義します.
Original:
The scoped enumeration std::errc defines the values of portable error conditions that correspond to the POSIX error codes.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

## 目次

### [編集]メンバー定数

 定数 Original: Constant The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. Explanation address_family_not_supported POSIXのコードEAFNOSUPPORTに対応するエラー状態Original: error condition corresponding to POSIX code EAFNOSUPPORTThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. address_in_use POSIXのコードEADDRINUSEに対応するエラー状態Original: error condition corresponding to POSIX code EADDRINUSEThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. address_not_available POSIXのコードEADDRNOTAVAILに対応するエラー状態Original: error condition corresponding to POSIX code EADDRNOTAVAILThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. already_connected POSIXのコードEISCONNに対応するエラー状態Original: error condition corresponding to POSIX code EISCONNThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. argument_list_too_long POSIXのコードE2BIGに対応するエラー状態Original: error condition corresponding to POSIX code E2BIGThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. argument_out_of_domain POSIXのコードEDOMに対応するエラー状態Original: error condition corresponding to POSIX code EDOMThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. bad_address POSIXのコードEFAULTに対応するエラー状態Original: error condition corresponding to POSIX code EFAULTThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. bad_file_descriptor POSIXのコードEBADFに対応するエラー状態Original: error condition corresponding to POSIX code EBADFThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. bad_message POSIXのコードEBADMSGに対応するエラー状態Original: error condition corresponding to POSIX code EBADMSGThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. broken_pipe POSIXのコードEPIPEに対応するエラー状態Original: error condition corresponding to POSIX code EPIPEThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. connection_aborted POSIXのコードに対応するエラー条件がECONNABORTEDOriginal: error condition corresponding to POSIX code ECONNABORTEDThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. connection_already_in_progress POSIXのコードEALREADYに対応するエラー状態Original: error condition corresponding to POSIX code EALREADYThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. connection_refused POSIXのコードに対応するエラー条件がECONNREFUSEDOriginal: error condition corresponding to POSIX code ECONNREFUSEDThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. connection_reset POSIXのコードECONNRESETに対応するエラー状態Original: error condition corresponding to POSIX code ECONNRESETThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. cross_device_link POSIXのコードEXDEVに対応するエラー状態Original: error condition corresponding to POSIX code EXDEVThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. destination_address_required POSIXのコードEDESTADDRREQに対応するエラー状態Original: error condition corresponding to POSIX code EDESTADDRREQThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. device_or_resource_busy POSIXのコードEBUSYに対応するエラー状態Original: error condition corresponding to POSIX code EBUSYThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. directory_not_empty POSIXのコードENOTEMPTYに対応するエラー状態Original: error condition corresponding to POSIX code ENOTEMPTYThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. executable_format_error POSIXのコードENOEXECに対応するエラー状態Original: error condition corresponding to POSIX code ENOEXECThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. file_exists POSIXのコードEEXISTに対応するエラー状態Original: error condition corresponding to POSIX code EEXISTThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. file_too_large POSIXのコードEFBIGに対応するエラー状態Original: error condition corresponding to POSIX code EFBIGThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. filename_too_long POSIXのコードENAMETOOLONGに対応するエラー状態Original: error condition corresponding to POSIX code ENAMETOOLONGThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. function_not_supported POSIXのコードENOSYSに対応するエラー状態Original: error condition corresponding to POSIX code ENOSYSThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. host_unreachable POSIXのコードEHOSTUNREACHに対応するエラー状態Original: error condition corresponding to POSIX code EHOSTUNREACHThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. identifier_removed POSIXのコードにEIDRM対応するエラー状態Original: error condition corresponding to POSIX code EIDRMThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. illegal_byte_sequence POSIXのコードEILSEQに対応するエラー状態Original: error condition corresponding to POSIX code EILSEQThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. inappropriate_io_control_operation POSIXのコードENOTTYに対応するエラー状態Original: error condition corresponding to POSIX code ENOTTYThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. interrupted POSIXのコードEINTRに対応するエラー状態Original: error condition corresponding to POSIX code EINTRThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. invalid_argument POSIXのコードをEINVALに対応するエラー状態Original: error condition corresponding to POSIX code EINVALThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. invalid_seek POSIXのコードESPIPEに対応するエラー状態Original: error condition corresponding to POSIX code ESPIPEThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. io_error POSIXのコードEIOに対応するエラー状態Original: error condition corresponding to POSIX code EIOThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. is_a_directory POSIXのコードEISDIRに対応するエラー状態Original: error condition corresponding to POSIX code EISDIRThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. message_size POSIXのコードEMSGSIZEに対応するエラー状態Original: error condition corresponding to POSIX code EMSGSIZEThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. network_down POSIXのコードENETDOWNに対応するエラー状態Original: error condition corresponding to POSIX code ENETDOWNThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. network_reset POSIXのコードENETRESETエラー番号に対応するエラー状態Original: error condition corresponding to POSIX code ENETRESETThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. network_unreachable POSIXのコードENETUNREACHに対応するエラー状態Original: error condition corresponding to POSIX code ENETUNREACHThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. no_buffer_space POSIXのコードENOBUFSに対応するエラー状態Original: error condition corresponding to POSIX code ENOBUFSThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. no_child_process POSIXのコードECHILDに対応するエラー状態Original: error condition corresponding to POSIX code ECHILDThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. no_link POSIXのコードENOLINKに対応するエラー状態Original: error condition corresponding to POSIX code ENOLINKThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. no_lock_available POSIXのコードENOLCKに対応するエラー状態Original: error condition corresponding to POSIX code ENOLCKThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. no_message_available POSIXのコードENODATAに対応するエラー状態Original: error condition corresponding to POSIX code ENODATAThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. no_message POSIXのコードENOMSGに対応するエラー状態Original: error condition corresponding to POSIX code ENOMSGThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. no_protocol_option POSIXのコードENOPROTOOPTに対応するエラー状態Original: error condition corresponding to POSIX code ENOPROTOOPTThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. no_space_on_device POSIXのコードENOSPCに対応するエラー状態Original: error condition corresponding to POSIX code ENOSPCThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. no_stream_resources POSIXのコードENOSRに対応するエラー状態Original: error condition corresponding to POSIX code ENOSRThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. no_such_device_or_address POSIXのコードENXIOに対応するエラー状態Original: error condition corresponding to POSIX code ENXIOThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. no_such_device POSIXのコードENODEVに対応するエラー状態Original: error condition corresponding to POSIX code ENODEVThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. no_such_file_or_directory POSIXのコードENOENTに対応するエラー状態Original: error condition corresponding to POSIX code ENOENTThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. no_such_process POSIXのコードESRCHに対応するエラー状態Original: error condition corresponding to POSIX code ESRCHThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. not_a_directory POSIXのコードENOTDIRに対応するエラー状態Original: error condition corresponding to POSIX code ENOTDIRThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. not_a_socket POSIXのコードENOTSOCKに対応するエラー状態Original: error condition corresponding to POSIX code ENOTSOCKThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. not_a_stream POSIXのコードENOSTRに対応するエラー状態Original: error condition corresponding to POSIX code ENOSTRThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. not_connected POSIXのコードENOTCONNに対応するエラー状態Original: error condition corresponding to POSIX code ENOTCONNThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. not_enough_memory POSIXのコードENOMEMに対応するエラー状態Original: error condition corresponding to POSIX code ENOMEMThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. not_supported POSIXのコードENOTSUPに対応するエラー状態Original: error condition corresponding to POSIX code ENOTSUPThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. operation_canceled POSIXのコードに対応するエラー条件がECANCELEDOriginal: error condition corresponding to POSIX code ECANCELEDThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. operation_in_progress POSIXのコードEINPROGRESSに対応するエラー状態Original: error condition corresponding to POSIX code EINPROGRESSThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. operation_not_permitted POSIXのコードのEPERMに対応するエラー状態Original: error condition corresponding to POSIX code EPERMThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. operation_not_supported POSIXのコードEOPNOTSUPPに対応するエラー状態Original: error condition corresponding to POSIX code EOPNOTSUPPThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. operation_would_block POSIXのコードにEWOULDBLOCK対応するエラー状態Original: error condition corresponding to POSIX code EWOULDBLOCKThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. owner_dead POSIXのコードEOWNERDEADに対応するエラー状態Original: error condition corresponding to POSIX code EOWNERDEADThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. permission_denied POSIXのコードEACCESに対応するエラー状態Original: error condition corresponding to POSIX code EACCESThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. protocol_error POSIXのコードEPROTOに対応するエラー状態Original: error condition corresponding to POSIX code EPROTOThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. protocol_not_supported POSIXのコードEPROTONOSUPPORTに対応するエラー状態Original: error condition corresponding to POSIX code EPROTONOSUPPORTThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. read_only_file_system POSIXのコードEROFSに対応するエラー状態Original: error condition corresponding to POSIX code EROFSThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. resource_deadlock_would_occur POSIXのコードEDEADLKに対応するエラー状態Original: error condition corresponding to POSIX code EDEADLKThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. resource_unavailable_try_again POSIXのコードEAGAINに対応するエラー状態Original: error condition corresponding to POSIX code EAGAINThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. result_out_of_range POSIXのコードERANGEに対応するエラー状態Original: error condition corresponding to POSIX code ERANGEThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. state_not_recoverable ENOTRECOVERABLE POSIXのコードに対応するエラー状態Original: error condition corresponding to POSIX code ENOTRECOVERABLEThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. stream_timeout POSIXのコードETIMEに対応するエラー状態Original: error condition corresponding to POSIX code ETIMEThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. text_file_busy POSIXのコードETXTBSYに対応するエラー状態Original: error condition corresponding to POSIX code ETXTBSYThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. timed_out POSIXのコードETIMEDOUTに対応するエラー状態Original: error condition corresponding to POSIX code ETIMEDOUTThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. too_many_files_open_in_system POSIXのコードENFILEに対応するエラー状態Original: error condition corresponding to POSIX code ENFILEThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. too_many_files_open POSIXのコードEMFILEに対応するエラー状態Original: error condition corresponding to POSIX code EMFILEThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. too_many_links POSIXのコードEMLINKに対応するエラー状態Original: error condition corresponding to POSIX code EMLINKThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. too_many_symbolic_link_levels POSIXのコードELOOPに対応するエラー状態Original: error condition corresponding to POSIX code ELOOPThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. value_too_large POSIXのコードEOVERFLOWに対応するエラー状態Original: error condition corresponding to POSIX code EOVERFLOWThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. wrong_protocol_type POSIXのコードEPROTOTYPEに対応するエラー状態Original: error condition corresponding to POSIX code EPROTOTYPEThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

### [編集]ヘルパークラス

 エラー条件としてstd::is_error_condition_enum値を識別する型形質std::errcを拡張しますOriginal: extends the type trait std::is_error_condition_enum to identify the the std::errc values as error conditionsThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数テンプレート)

### [編集]非メンバ関数

 make_error_code(std::errc)(C++11) std::errcエラー·コードを作成しますOriginal: constructs an std::errc error codeThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数) std::errcエラー条件を構築しますOriginal: constructs an std::errc error conditionThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数)

### [編集]例

#include <iostream>
#include <system_error>
int main()
{
try {
} catch (const std::system_error& e) {
std::cout << "Caught a system_error\n";
if(e.code() == std::errc::invalid_argument)
std::cout << "The error condition is std::errc::invalid_argument\n";
std::cout << "the error description is " << e.what() << '\n';
}
}

Caught a system_error
The error condition is std::errc::invalid_argument
the error description is Invalid argument

### [編集]参照

 error_code(C++11) プラットフォーム依存のエラーコードを保持します (クラス)  error_condition(C++11) 移植性のあるエラーコードを保持します (クラス)