std::generic_category
提供: cppreference.com
|
|
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
| ヘッダ <system_error> で定義
|
||
| const std::error_category& generic_category(); |
(C++11およびそれ以降) | |
一般的なエラーのための静的なエラーカテゴリオブジェクトへの参照を取得します。オブジェクトは、文字列error_category::name()へのポインタを返す仮想関数"generic"をオーバーライドする必要があります。それはPOSIXerrnoコードに対応するエラー条件を識別するために使用され.
Original:
Obtains a reference to the static error category object for generic errors. The object is required to override the virtual function error_category::name() to return a pointer to the string "generic". It is used to identify error conditions that correspond to the POSIX errno codes.
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.
目次 |
[編集] パラメータ
(なし)
[編集] 値を返します
std::error_category由来不特定の実行時の型の静的オブジェクトへの参照.
Original:
A reference to the static object of unspecified runtime type, derived from std::error_category.
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.
[編集] 例外
noexcept 指定:
noexcept
[編集] 例
Run this code
#include <iostream> #include <system_error> #include <cerrno> #include <string> int main() { std::error_condition econd = std::generic_category().default_error_condition(EDOM); std::cout << "Category: " << econd.category().name() << '\n' << "Value: " << econd.value() << '\n' << "Message: " << econd.message() << '\n'; }
出力:
Category: generic Value: 33 Message: Numerical argument out of domain
[編集] 参照
| (C++11) |
オペレーティングシステムのエラーカテゴリを識別します (関数) |
| (C++11) |
標準の <cerrno> のマクロ定数をすべて並べた std::error_condition 用の列挙型 (クラス) |

