nested_exception 類別
類別描述與多個繼承搭配使用的例外狀況。 它會擷取目前處理的例外狀況,並儲存它以供日後使用。
語法
class nested_exception {
public:
nested_exception();
nested_exception(const nested_exception&) = default;
virtual ~nested_exception() = default; // access functions
};
成員
操作員
名稱 | 描述 |
---|---|
operator= | 指派運算子。 |
函式
名稱 | 描述 |
---|---|
rethrow_nested | 擲回儲存的例外狀況。 |
nested_ptr | 傳回儲存的例外狀況。 |
operator=
nested_exception& operator=(const nested_exception&) = default;
nested_ptr
exception_ptr nested_ptr() const;
傳回值
這個 nested_exception
物件所擷取的預存例外狀況。
rethrow_nested
[[noreturn]] void rethrow_nested() const;
備註
如果 nested_ptr()
傳回 Null 指標,則函式會呼叫 std::terminate()
。 否則,它會擲回 所擷取的預存例外狀況 *this
。
需求
標頭: < exception>
命名空間:std
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應