std::meta::exception
ja.cppreference.net より
| ヘッダ <meta>
|
||
class exception : public std::exception
|
で定義 (C++26) | |
リフレクション関数の失敗時にスローされるオブジェクトの型を定義します。
型 std::meta::exception のオブジェクトは、定数評価内でのみ作成およびアクセスできます。
メンバ関数
(コンストラクタ) |
meta::exception オブジェクトを構築する (パブリックメンバ関数) |
what |
説明文字列を返す (パブリックメンバ関数) |
u8what |
説明文字列を std::u8string_view として返す (パブリックメンバ関数) |
from |
関連する std::meta::info オブジェクトを返す (パブリックメンバ関数) |
where |
関連する std::source_location を返す (パブリックメンバ関数) |
std::meta::exception::exception
consteval exception( std::u8string_view u8what_arg, std::meta::info from,
std::source_location where = std::source_location::current() ) noexcept;
|
(1) | |
consteval exception( std::string_view what_arg, std::meta::info from,
std::source_location where = std::source_location::current() ) noexcept;
|
(2) | |
consteval exception( const exception& ) = default;
|
(3) | |
consteval exception( exception&& ) = default;
|
(4) | |
新しい std::meta::info オブジェクトを構築します。格納された値を対応するパラメータで初期化します。
1)
u8what_arg が通常のリテラルエンコーディングで表現可能な場合、what() によって返される説明文字列は u8what_arg UTF-8 から通常のリテラルエンコーディングに変換されます。そうでない場合、what() の呼び出しは定数式ではありません。2)
what_arg は UTF-8 で表現可能でなければなりません。3) コピーコンストラクタはデフォルト設定されます。
4) ムーブコンストラクタはデフォルト設定されます。
std::meta::exception::what
constexpr const char* what() const noexcept override;
|
||
構築時に渡された説明文字列を返します。UTF-8 から通常のリテラルエンコーディングに変換される可能性があります。
std::meta::exception::u8what
consteval std::u8string_view u8what() const noexcept;
|
||
構築時に渡された説明文字列を返します。通常のリテラルエンコーディングから UTF-8 に変換される可能性があります。
std::meta::exception::from
consteval std::meta::info from() const noexcept;
|
||
構築時に渡された std::meta::info 値を返します。
std::meta::exception::where
consteval std::source_location where() const noexcept;
|
||
構築時に渡された std::source_location 値を返します。
例
| この節は不完全です 理由: 例がありません |