virtual const char* what() const; // (1) C++98
virtual const char* what() const noexcept; // (1) C++11
const char* what() const noexcept override; // (1) C++17
constexpr const char* what() const noexcept override; // (1) C++26
概要
エラー理由となる実装依存文字列を取得する。
戻り値
処理系定義のNULL終端マルチバイト文字列へのポインタを返す。
返されたポインタの指す文字列は、それを取得した例外オブジェクトを破棄するか、その例外オブジェクトに対して非constなメンバ関数を呼び出すまで有効である。
例外
投げない
備考
- C++11 : 動的な型が同じ
Tである2つのオブジェクトlhsとrhsについて、lhsがrhsのコピーである場合、std::strcmp(lhs.what(), rhs.what()) == 0が成り立つ