- ios[meta header]
- std[meta namespace]
- function[meta id-type]
- cpp11[meta cpp]
namespace std {
const error_category& iostream_category(); // C++11
const error_category& iostream_category() noexcept; // C++14
}
- error_category[link /reference/system_error/error_category.md]
io_errc
のためのエラーカテゴリを取得する。
error_category
クラスを継承したクラスオブジェクトへの参照を返す。
この関数を呼び出すことによって返されるオブジェクトは、同じオブジェクトを指す。
この関数によって返されるオブジェクトのクラスは以下の特徴を持つ:
name()
関数によって返される文字列は"iostream"
default_error_condition()
仮想関数およびequivalent()
仮想関数の挙動は、基底クラスであるerror_category
と同じである
投げない
#include <iostream> // 自動的に<ios>もインクルードされる
#include <string>
int main()
{
const std::error_category& cat = std::iostream_category();
std::cout << cat.name() << std::endl;
std::cout << cat.message(static_cast<int>(std::io_errc::stream)) << std::endl;
}
- std::iostream_category[color ff0000]
- std::error_category[link /reference/system_error/error_category.md]
- cat.name()[link /reference/system_error/error_category/name.md]
- cat.message[link /reference/system_error/error_category/message.md]
- std::io_errc::stream[link io_errc.md]
iostream
iostream stream error
- C++11
- Clang: ??
- GCC: ??
- ICC: ??
- Visual C++: 2010 [mark verified], 2012 [mark verified]