Namespaces
Variants

std::experimental:: bad_any_cast

From cppreference.net
ヘッダーで定義 <experimental/any>
class bad_any_cast : public std:: bad_cast ;
(ライブラリ基盤仕様 TS)

値返し形式の std::experimental::any_cast が失敗した際にスローされるオブジェクトの型を定義します。

目次

メンバー関数

(constructor)
新しい bad_any_cast オブジェクトを構築する
(public member function)
operator=
bad_any_cast オブジェクトを置き換える
(public member function)
what
説明文字列を返す
(public member function)

std::experimental::bad_any_cast:: bad_any_cast

bad_any_cast ( ) noexcept ;
(1) (library fundamentals TS)
bad_any_cast ( const bad_any_cast & other ) noexcept ;
(2) (library fundamentals TS)

bad_any_cast オブジェクトを構築します。実装定義のnull終端バイト文字列を含み、これは what() を通じてアクセス可能です。

1) デフォルトコンストラクタ。
2) コピーコンストラクタ。 * this other の両方が動的型 std::experimental::bad_any_cast を持つ場合、 std:: strcmp ( what ( ) , other. what ( ) ) == 0 となります。

パラメータ

other - コピーする別の例外オブジェクト

std::experimental::bad_any_cast:: operator=

bad_any_cast & operator = ( const bad_any_cast & other ) noexcept ;
(ライブラリ基盤 TS)

other の内容を代入します。 * this other の両方が動的型 std::experimental::bad_any_cast を持つ場合、代入後は std:: strcmp ( what ( ) , other. what ( ) ) == 0 となります。

パラメータ

other - 代入する別の例外オブジェクト

戻り値

* this

std::experimental::bad_any_cast:: what

virtual const char * what ( ) const noexcept ;
(ライブラリ基盤 TS)

説明文字列を返します。

戻り値

説明情報を含む実装定義のナル終端文字列へのポインタ。この文字列は std::wstring への変換と表示に適しています。ポインタは、少なくとも取得元の例外オブジェクトが破棄されるまで、または例外オブジェクトの非constメンバ関数(コピー代入演算子など)が呼び出されるまで有効であることが保証されます。

注記

実装は what() をオーバーライドすることが許可されていますが、必須ではありません。

std:: bad_cast から継承

std::exception から継承 std:: exception

メンバ関数

例外オブジェクトを破棄
( std::exception の仮想公開メンバ関数)
[仮想]
説明文字列を返す
( std::exception の仮想公開メンバ関数)