名前空間
変種
操作

std::tx_exception

From cppreference.com
< cpp‎ | error
 
 
 
ヘッダー <stdexcept> で定義
template< class T >
class tx_exception : public std::runtime_error;
(TM TS)

atomic_cancelキーワードによって開始されたアトミックトランザクションをキャンセルおよびロールバックするために使用できる例外型を定義します。

TTriviallyCopyableでない場合、std::tx_exception<T>を特殊化するプログラムはill-formedです。

目次

[編集] メンバ関数

std::tx_exception::tx_exception

explicit tx_exception( T value ) transaction_safe;
(1) (TM TS)
tx_exception( T value, const std::string& what_arg ) transaction_safe;
(2) (TM TS)
tx_exception( T value, const char* what_arg ) transaction_safe;
(3) (TM TS)
tx_exception( const tx_exception& other ) transaction_safe noexcept;
(4) (TM TS)
1-3) `what()`でアクセス可能な説明文字列として`what_arg`、`get()`でアクセス可能なオブジェクトとして`value`で例外オブジェクトを構築します。
4) コピーコンストラクタ。 `*this`と`other`が両方とも動的型`std::tx_exception<T>`を持つ場合、代入後に`std::strcmp(what(), other.what()) == 0`となります。

パラメータ

value - ペイロードオブジェクト
what_arg - 説明文字列
その他 - コピーする別の例外オブジェクト

例外

1-3) 実装定義の例外を投げる可能性があります。

std::tx_exception::operator=

tx_exception& operator=( const tx_exception& other ) transaction_safe noexcept;
(TM TS)

`other`の内容を`*this`に代入します。 `*this`と`other`が両方とも動的型`std::tx_exception<T>`を持つ場合、代入後に`std::strcmp(what(), other.what()) == 0`となります。

パラメータ

その他 - 割り当てる別の例外オブジェクト

戻り値

*this

std::tx_exception::get

T get() const transaction_safe;
(TM TS)

例外オブジェクトが保持しているペイロードオブジェクトを返します。

例外

実装定義の例外をスローする場合があります。

std::tx_exception::what

virtual const char* what() const transaction_safe_dynamic noexcept;
(TM TS)

説明文字列を返します。

パラメータ

(なし)

戻り値

説明情報を含むヌル終端文字列へのポインタ。

std::runtime_error から継承


std::exception から継承

メンバ関数

例外オブジェクトを破棄する
(std::exception の仮想 public メンバー関数) [編集]
[virtual]
説明文字列を返す
(std::exception の仮想 public メンバー関数) [編集]
English 日本語 中文(简体) 中文(繁體)