Skip to content

Latest commit

 

History

History
61 lines (46 loc) · 2.03 KB

system_category.md

File metadata and controls

61 lines (46 loc) · 2.03 KB

#system_category

namespace std {
  const error_category& system_category() noexcept;
}
  • error_category[link ./error_category.md]

##概要 環境固有のエラーに関するerror_categoryを返す。

##戻り値 error_categoryクラスを継承したクラスオブジェクトへの参照を返す。 この関数を呼び出すことによって返されるオブジェクトは、同じオブジェクトを指す。

この関数によって返されるオブジェクトのクラスは以下の特徴を持つ:

##例外 投げない

##例

#include <iostream>
#include <system_error>
#include <string>

int main()
{
  const std::error_category& cat = std::system_category();

  std::cout << cat.name() << std::endl;
  std::cout << cat.message(static_cast<int>(std::errc::invalid_argument)) << std::endl;
}
  • system_category[color ff0000]

###出力

system
Invalid argument

##バージョン ###言語

  • C++11

###処理系

##参照