Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::make_exception_ptr

      From cppreference.com
      <cpp‎ |error
       
       
      Diagnostics library
       
      Defined in header<exception>
      template<class E>
      std::exception_ptr make_exception_ptr( E e)noexcept;
      (since C++11)
      (constexpr since C++26)

      Creates anstd::exception_ptr that holds a reference to a copy ofe. This is done as if executing the following code:

      try{throw e;}catch(...){returnstd::current_exception();}

      Contents

      [edit]Parameters

      e - exception object to create a reference to the copy of

      [edit]Return value

      An instance ofstd::exception_ptr holding a reference to the copy ofe, or to an instance ofstd::bad_alloc or to an instance ofstd::bad_exception (seestd::current_exception).

      [edit]Notes

      The parameter is passed by value and is subject to slicing.

      Feature-test macroValueStdFeature
      __cpp_lib_constexpr_exceptions202411L(C++26)constexpr for exception types

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      captures the current exception in astd::exception_ptr
      (function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/error/make_exception_ptr&oldid=177871"

      [8]ページ先頭

      ©2009-2025 Movatter.jp