Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::tx_exception

      From cppreference.com
      <cpp‎ |error
       
       
      Diagnostics library
       
      Defined in header<stdexcept>
      template<class T>
      class tx_exception:publicstd::runtime_error;
      (TM TS)

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

      IfT is notTriviallyCopyable, the program that specializesstd::tx_exception<T> is ill-formed.

      Contents

      [edit]Member functions

      std::tx_exception::tx_exception

      explicit tx_exception( T value) transaction_safe;
      (1)(TM TS)
      tx_exception( T value,conststd::string& what_arg) transaction_safe;
      (2)(TM TS)
      tx_exception( T value,constchar* what_arg) transaction_safe;
      (3)(TM TS)
      tx_exception(const tx_exception& other) transaction_safenoexcept;
      (4)(TM TS)
      1-3) Constructs the exception object withwhat_arg as explanatory string that can be accessed throughwhat() andvalue as the object that can be accessed throughget().
      4) Copy constructor. If*this andother both have dynamic typestd::tx_exception<T> thenstd::strcmp(what(), other.what())==0.

      Parameters

      value - payload object
      what_arg - explanatory string
      other - 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_safenoexcept;
      (TM TS)

      Assigns the contents with those ofother. If*this andother both have dynamic typestd::tx_exception<T> thenstd::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

      virtualconstchar* what()const transaction_safe_dynamicnoexcept;
      (TM TS)

      Returns the explanatory string.

      Parameters

      (none)

      Return value

      Pointer to a null-terminated string with explanatory information.

      Inherited fromstd::runtime_error


      Inherited fromstd::exception

      Member functions

      [virtual]
      destroys the exception object
      (virtual public member function ofstd::exception)[edit]
      [virtual]
      returns an explanatory string
      (virtual public member function ofstd::exception)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/error/tx_exception&oldid=160413"

      [8]ページ先頭

      ©2009-2025 Movatter.jp