GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • cpprefjp - C++日本語リファレンス
  • GitHub Project

This view

  • Original page
  • New address

GeezerVison is showing cpprefjp.github.io — std::make_error_code - cpprefjp C++日本語リファレンス

  1. リファレンス
  2. future
  3. make_error_code

最終更新日時: 2026年09月19日 21時31分51秒 (JST)
rotarymars が更新

履歴 編集

function
<future>

std::make_error_code(C++11)

namespace std {
  error_code make_error_code(future_errc e) noexcept;
}

概要

future_errcからerror_codeを生成する

戻り値

error_code(static_cast<int>(e), future_category())

例外

投げない

例

#include <iostream>
#include <future>
#include <string>

int main()
{
  std::error_code ec = std::make_error_code(std::future_errc::broken_promise);

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

出力例

category : future
value : 4
message : Broken promise

バージョン

言語

  • C++11

処理系

  • Clang: 9.0.1 ✅
  • GCC: 4.7.0 ✅
  • Visual C++: 2012 ✅
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.