std:: make_exception_ptr
|
Definiert im Header
<exception>
|
||
|
template
<
class
E
>
std:: exception_ptr make_exception_ptr ( E e ) noexcept ; |
(seit C++11)
(constexpr seit C++26) |
|
Erstellt einen std::exception_ptr , der eine Referenz auf eine Kopie von e enthält. Dies geschieht wie bei der Ausführung des folgenden Codes:
try { throw e; } catch(...) { return std::current_exception(); }
Inhaltsverzeichnis |
Parameter
| e | - | Ausnahmeobjekt, um eine Referenz auf die Kopie zu erstellen |
Rückgabewert
Eine Instanz von std::exception_ptr , die eine Referenz auf die Kopie von e enthält, oder auf eine Instanz von std::bad_alloc oder auf eine Instanz von std::bad_exception (siehe std::current_exception ).
Hinweise
Der Parameter wird als Wert übergeben und unterliegt Slicing.
| Feature-Test Makro | Wert | Std | Feature |
|---|---|---|---|
__cpp_lib_constexpr_exceptions
|
202411L
|
(C++26) | constexpr für Ausnahmetypen |
Beispiel
|
Dieser Abschnitt ist unvollständig
Grund: Kein Beispiel |
Siehe auch
|
(C++11)
|
erfasst die aktuelle Ausnahme in einem
std::exception_ptr
(Funktion) |