最終更新日時(UTC):
が更新

履歴 編集

function
<ios>

std::make_error_condition(C++11)

namespace std {
  error_condition make_error_condition(io_errc e);          // C++11
  error_condition make_error_condition(io_errc e) noexcept; // C++14
}

概要

io_errcからerror_conditionを生成する

戻り値

error_condition(static_cast<int>(e), iostream_category())

例外

投げない

#include <iostream>

int main()
{
  std::error_condition ec = std::make_error_condition(std::io_errc::stream);

  std::cout << "category : " << ec.category().name() << std::endl;
  std::cout << "value : " << ec.value() << std::endl;
  std::cout << "message : " << ec.message() << std::endl;
}

出力例

category : iostream
value : 1
message : iostream stream error

バージョン

言語

  • C++11

処理系

参照