Defined in header <stdexcept> | ||
|---|---|---|
template< class T > class tx_exception : public std::runtime_error; | (TM TS) |
Defines an exception type that can be used to cancel and roll back an atomic transaction initiated by the keyword atomic_cancel.
If T is not TriviallyCopyable, the program that specializes std::tx_exception<T> is ill-formed.
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) |
what_arg as explanatory string that can be accessed through what() and value as the object that can be accessed through get().*this and other both have dynamic type std::tx_exception<T> then std::strcmp(what(), other.what()) == 0.| value | - | payload object |
| what_arg | - | explanatory string |
| other | - | another exception object to copy |
tx_exception& operator=( const tx_exception& other ) transaction_safe noexcept; | (TM TS) |
Assigns the contents with those of other. If *this and other both have dynamic type std::tx_exception<T> then std::strcmp(what(), other.what()) == 0 after assignment.
| other | - | another exception object to assign with |
*this.
T get() const transaction_safe; | (TM TS) |
Returns the payload object held by the exception object.
May throw implementation-defined exceptions.
virtual const char* what() const transaction_safe_dynamic noexcept; | (TM TS) |
Returns the explanatory string.
(none).
Pointer to a null-terminated string with explanatory information.
|
[virtual] | destroys the exception object (virtual public member function of std::exception) |
|
[virtual] | returns an explanatory string (virtual public member function of std::exception) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/error/tx_exception