std::system_error
提供: cppreference.com
![]() |
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
Defined in header <system_error>
|
||
class system_error; |
(C++11およびそれ以降) | |
std::system_error
例外が報告される必要が関連付けられているstd::threadを持ってさまざまなライブラリ関数(通常はOSの設備を備えたインタフェースは、std::error_codeのコンストラクタを例えばする関数)によってスローされた例外の型です.Original:
std::system_error
is the type of the exception thrown by various library functions (typically the functions that interface with the OS facilities, e.g. the constructor of std::thread), when the exception has an associated std::error_code which needs to be reported.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.
目次 |
[編集] メンバ関数
system_error オブジェクトを作成しますOriginal: constructs the system_error objectThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
エラーコードを返します Original: returns error code The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
[仮想] |
説明文字列を返します Original: returns explanatory string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (仮想パブリックメンバ関数) |
Inherited from std::exception
Member functions
[仮想] |
例外オブジェクトを破棄します Original: destructs the exception object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (仮想パブリックメンバ関数of std::exception )
|
[仮想] |
説明文字列を返します Original: returns an explanatory string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (仮想パブリックメンバ関数of std::exception )
|
[編集] 例
このコードを実行します
#include <thread> #include <iostream> #include <system_error> int main() { try { std::thread().detach(); // attempt to detach a non-thread } catch(const std::system_error& e) { std::cout << "Caught system_error with code " << e.code() << " meaning " << e.what() << '\n'; } }
出力:
Caught system_error with code generic:22 meaning Invalid argument