cpp/error/tx exception

Defines an exception type that can be used to cancel and roll back an atomic transaction initiated by the keyword

If is not, the program that specializes  is ill-formed.

Member functions
{{member|{{small|std::tx_exception::}}tx_exception|2= {{dcl begin}} {{dcl|num=1|since=tm_ts| explicit tx_exception( T value ) transaction_safe; }} {{dcl|num=2|since=tm_ts| tx_exception( T value, const std::string& what_arg ) transaction_safe; }} {{dcl|num=3|since=tm_ts| tx_exception( T value, const char* what_arg ) transaction_safe; }} {{dcl|num=4|since=tm_ts| tx_exception( const tx_exception& other ) transaction_safe noexcept; }} {{dcl end}}

@1-3@ Constructs the exception object with {{tt|what_arg}} as explanatory string that can be accessed through {{lc|what}} and {{tt|value}} as the object that can be accessed through {{lc|get}}.

@4@ Copy constructor. If {{tt|*this}} and {{tt|other}} both have dynamic type {{tt|std::tx_exception}} then {{c|1=std::strcmp(what, other.what) == 0}}.

Exceptions
@1-3@ May throw implementation-defined exceptions. }}

{{member|{{small|std::tx_exception::}}operator{{=}}| {{dcl begin}} {{dcl|since=tm_ts|1= tx_exception& operator=( const tx_exception& other ) transaction_safe noexcept; }} {{dcl end}}

Assigns the contents with those of {{tt|other}}. If {{tt|*this}} and {{tt|other}} both have dynamic type {{tt|std::tx_exception}} then {{c|1=std::strcmp(what, other.what) == 0}} after assignment.

Return value
}}

{{member|{{small|std::tx_exception::}}get|2= {{dcl begin}} {{dcl|since=tm_ts| T get const transaction_safe; }} {{dcl end}}

Returns the payload object held by the exception object.

Exceptions
May throw implementation-defined exceptions. }}

{{member|{{small|std::tx_exception::}}what| {{dcl begin}} {{dcl|since=tm_ts| virtual const char* what const transaction_safe_dynamic noexcept; }} {{dcl end}}

Returns the explanatory string.

Parameters
(none)

Return value
Pointer to a null-terminated string with explanatory information. }}