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

  1. リファレンス
  2. expected

最終更新日時: 2026年09月11日 13時06分31秒 (JST)
Akira Takahashi が更新

履歴 編集

<expected>

expected(C++23)

<expected>ヘッダでは、任意の正常値または任意のエラー値のどちらかを持たせられるオブジェクトの型を定義する。

フリースタンディング

このヘッダのほとんどの機能は、フリースタンディング処理系でも使用できる。ただし、expected::value()メンバ関数は、エラー値を保持しているときに例外を送出するため、フリースタンディング処理系では削除される。

機能一覧

名前 説明 対応バージョン
expected 正常値かエラー値を保持するオブジェクト (class template) C++23
unexpected エラー値の代入補助クラス (class template) C++23
unexpect_t エラー値の直接構築を指示するタグ型 (class) C++23
bad_expected_access エラー値保持時に正常値へアクセスした場合に発生する例外 (class template) C++23

バージョン

言語

  • C++23

処理系

  • Clang: 16.0 ✅
  • GCC: 12.1 ✅
  • Visual C++: ??

関連項目

  • optional

参照

  • P0323R12 std::expected
  • P2549R1 std::unexpected<E> should have error() as member accessor
  • P2505R5 Monadic Functions for std::expected
  • P2833R2 Freestanding Library: inout expected span
    • C++26で、このヘッダが(例外を送出するメンバなど一部を除いて)フリースタンディング処理系に対応した
You are visitor 01402520 — 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.