![]() |
Scarab
v3.5.0
Project 8 C++ Utility Library
|
Base class for exceptions with streaming operators. More...
#include <base_exception.hh>
Public Member Functions | |
base_exception () | |
base_exception (const base_exception< x_derived > &a_orig) | |
virtual | ~base_exception () noexcept |
base_exception< x_derived > & | operator= (const base_exception< x_derived > &a_orig) |
template<class x_streamable > | |
x_derived & | operator<< (x_streamable a_fragment) |
x_derived & | operator<< (const std::string &a_fragment) |
x_derived & | operator<< (const char *a_fragment) |
virtual const char * | what () const noexcept |
Protected Attributes | |
std::string | f_error |
Base class for exceptions with streaming operators.
This class provides streaming operators for building up the what()
message. It's meant to be the base class for any exceptions wanting to use that feature.
This class uses the Curiously Recurring Template Pattern (CRTP) to get the derived class type to appear in the base class. In particular, we need to return x_derived& from the various operator<<() so that those functions can be used in a throw statement and the user can still catch the derived type.
Definition at line 35 of file base_exception.hh.
base_exception | ( | ) |
Definition at line 56 of file base_exception.hh.
base_exception | ( | const base_exception< x_derived > & | a_orig | ) |
Definition at line 62 of file base_exception.hh.
|
virtualnoexcept |
Definition at line 68 of file base_exception.hh.
x_derived & operator<< | ( | x_streamable | a_fragment | ) |
Definition at line 86 of file base_exception.hh.
x_derived & operator<< | ( | const std::string & | a_fragment | ) |
Definition at line 95 of file base_exception.hh.
x_derived & operator<< | ( | const char * | a_fragment | ) |
Definition at line 102 of file base_exception.hh.
base_exception< x_derived > & operator= | ( | const base_exception< x_derived > & | a_orig | ) |
Definition at line 72 of file base_exception.hh.
|
virtualnoexcept |
Definition at line 79 of file base_exception.hh.
|
mutableprotected |
Definition at line 52 of file base_exception.hh.