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::error_code::category - cpprefjp C++日本語リファレンス

  1. リファレンス
  2. system_error
  3. error_code
  4. category

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

履歴 編集

function
<system_error>

std::error_code::category(C++11)

const error_category& category() const noexcept;

概要

包含しているエラーカテゴリへの参照を返す

戻り値

包含しているエラーカテゴリへの参照

例外

投げない

例

#include <iostream>
#include <system_error>

int main()
{
  std::error_code ec(static_cast<int>(std::errc::invalid_argument),
                     std::generic_category());

  const std::error_category& cat = ec.category();
  std::cout << cat.name() << std::endl;
}

出力

generic

バージョン

言語

  • C++11

処理系

  • Clang: 9.0.1 ✅
  • GCC: 4.6.1 ✅
  • Visual C++: 2010 ✅
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.