Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 1017 Bytes

op_constructor.md

File metadata and controls

35 lines (24 loc) · 1017 Bytes

コンストラクタ

  • format[meta header]
  • std[meta namespace]
  • format_error[meta class]
  • function[meta id-type]
  • cpp20[meta cpp]
explicit format_error(const string& what_arg);           // (1) C++20
constexpr explicit format_error(const string& what_arg); // (1) C++26

explicit format_error(const char* what_arg);           // (2) C++20
constexpr explicit format_error(const char* what_arg); // (2) C++26

概要

format_errorオブジェクトを構築する。

  • (1) : std::stringオブジェクトでエラー理由を受け取る
  • (2) : const char*でエラー理由を受け取る

事後条件

  • (1) : strcmp(what(), what_arg.c_str()) == 0
  • (2) : strcmp(what(), what_arg) == 0

関連項目

参照