|
DocWire SDK
DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, document analysis. Offline processing possible for security and confidentiality
|
A template class that simplifies the creation of nested exceptions. More...
#include <nested_exception.h>
Public Member Functions | |
| nested (T &&t) | |
Constructs a nested object from an rvalue reference to an object of type T. More... | |
| nested (const T &t) | |
Constructs a nested object from a const lvalue reference to an object of type T. More... | |
A template class that simplifies the creation of nested exceptions.
In C++, creating a nested exception using std::nested_exception requires throwing and catching an inner exception, and then using std::throw_with_nested to create the nested exception. This template class, together with make_nested macro provides a more straightforward way to create nested exceptions without the need for throwing and catching.
| T | The type of the outer exception. |
Definition at line 34 of file nested_exception.h.
|
inline |
Constructs a nested object from an rvalue reference to an object of type T.
Outer exception is constructed from the rvalue reference. Inner exception is captured using std::current_exception() and stored in the std::nested_exception base class.
| t | An rvalue reference to an object of type T. |
Definition at line 46 of file nested_exception.h.
|
inline |
Constructs a nested object from a const lvalue reference to an object of type T.
Outer exception is constructed from the lvalue reference. exception is captured using std::current_exception() and stored in the std::nested_exception base class.
| t | A const lvalue reference to an object of type T. |
Definition at line 59 of file nested_exception.h.