Skip to content

Latest commit

 

History

History
76 lines (52 loc) · 1.69 KB

File metadata and controls

76 lines (52 loc) · 1.69 KB
description Learn more about: nested_exception Class
title nested_exception Class
ms.date 06/17/2022
f1_keywords
exception/std::nested_exception
helpviewer_keywords
nested_exception class
ms.assetid 5ae2c4ef-c7ad-4469-8a9e-a773e86bb000
ms.custom devdivchpfy22

nested_exception Class

The class describes an exception for use with multiple inheritance. It captures the currently handled exception and stores it for later use.

Syntax

class nested_exception {
    public:
        nested_exception();
        nested_exception(const nested_exception&) = default;
        virtual ~nested_exception() = default; // access functions
};

Members

Operators

Name Description
operator= Assignment operator.

Functions

Name Description
rethrow_nested Throws the stored exception.
nested_ptr Returns the stored exception.

operator=

nested_exception& operator=(const nested_exception&) = default;

nested_ptr

exception_ptr nested_ptr() const;

Return Value

The stored exception captured by this nested_exception object.

rethrow_nested

[[noreturn]] void rethrow_nested() const;

Remarks

If nested_ptr() returns a null pointer, the function calls std::terminate(). Otherwise, it throws the stored exception captured by *this.

Requirements

Header: <exception>

Namespace: std

See also

exception Class
Thread Safety in the C++ Standard Library