| description | Learn more about: nested_exception Class | |
|---|---|---|
| title | nested_exception Class | |
| ms.date | 06/17/2022 | |
| f1_keywords |
|
|
| helpviewer_keywords |
|
|
| ms.assetid | 5ae2c4ef-c7ad-4469-8a9e-a773e86bb000 | |
| ms.custom | devdivchpfy22 |
The class describes an exception for use with multiple inheritance. It captures the currently handled exception and stores it for later use.
class nested_exception {
public:
nested_exception();
nested_exception(const nested_exception&) = default;
virtual ~nested_exception() = default; // access functions
};| Name | Description |
|---|---|
| operator= | Assignment operator. |
| Name | Description |
|---|---|
| rethrow_nested | Throws the stored exception. |
| nested_ptr | Returns the stored exception. |
nested_exception& operator=(const nested_exception&) = default;exception_ptr nested_ptr() const;The stored exception captured by this nested_exception object.
[[noreturn]] void rethrow_nested() const;If nested_ptr() returns a null pointer, the function calls std::terminate(). Otherwise, it throws the stored exception captured by *this.
Header: <exception>
Namespace: std