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

履歴 編集

function
<expected>

std::bad_expected_access::コンストラクタ(C++23)

概要

  • (1) : エラー値をstd::move(e)で初期化する。
  • (2) : コピーコンストラクタ。
  • (3) : ムーブコンストラクタ。

#include <cassert>
#include <expected>

int main()
{
  std::bad_expected_access<int> ex{42};
  assert(ex.error() == 42);
}

出力

バージョン

言語

  • C++23

処理系

参照