std::tx_exception(3)
π std::tx_exception π
Okay bestie, welcome to the std::tx_exception(3) page from the C++ Standard Libary manual β yes, the header literally spells it Libary, and weβre keeping that detail because details are sacred π.
β¨ NAME β¨
std::tx_exception β and the name is literally std::tx_exception, no cap, thatβs the whole vibe.
π¦ Synopsis π¦
Defined in header <stdexcept> π
template< class T >
class tx_exception : public std::runtime_error;
(TM TS)
This defines an exception type that can be used to cancel and roll back an atomic transaction initiated by the keyword atomic_cancel β itβs giving very much βtransaction-safe iconβ energy fr fr π₯.
If T is not TriviallyCopyable, the program that specializes std::tx_exception<T> is ill-formed. Thatβs a hard no, bestie π.
π Member functions π
π« 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) Constructs the exception object with what_arg as the explanatory string that can be accessed through what() and value as the object that can be accessed through get().
4) Copy constructor. If *this and other both have dynamic type std::tx_exception<T> then std::strcmp(what(), other.what()) == 0.
πΈ Parameters πΈ
valueβ payload objectwhat_argβ explanatory stringotherβ another exception object to copy
π Exceptions π
1-3) May throw implementation-defined exceptions.
π std::tx_exception::operator= π
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.
πΈ Parameters πΈ
otherβ another exception object to assign with
β Return value β
*this
π§ std::tx_exception::get π§
T get() const transaction_safe; (TM TS)
Returns the payload object held by the exception object.
π Exceptions π
May throw implementation-defined exceptions.
π std::tx_exception::what π
virtual const char* what() const transaction_safe_dynamic noexcept; (TM TS)
Returns the explanatory string.
πΈ Parameters πΈ
(none)
β Return value β
Pointer to a null-terminated string with explanatory information.
π«Ά Inherited from std::runtime_error π«Ά
Yep, itβs in the std::runtime_error family tree β thatβs the whole note, bestie, no invented lore π.
β¨ Inherited from std::exception β¨
π Member functions π
destructorβ destroys the exception object;[virtual](virtual public member function ofstd::exception)whatβ returns an explanatory string;[virtual](virtual public member function ofstd::exception)
mwah π source/version: http://cppreference.com Β· date: 2024.06.10 Β· page: std::tx_exception(3) β thatβs the sign-off, periodt π«Άπ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms