SlHelpers
SlHelpers::RuntimeException Class Reference

Class for easier construction of std::runtime_error. More...

#include <Exception.h>

Classes

struct  ThrowNow
 

Public Member Functions

 RuntimeException (std::string_view str)
 Construct new RuntimeException, having str as the initial exception string.
 
template<typename T >
RuntimeExceptionoperator<< (const T &msg)
 Add more to the exception string.
 
std::string str () const
 Return the stored exception string.
 
auto getRE () const
 Create and return std::runtime_error.
 
void raise () const
 Create and throw std::runtime_error.
 
void operator<< (const ThrowNow &)
 Create and throw std::runtime_error.
 

Detailed Description

Class for easier construction of std::runtime_error.

To be used as:

RuntimeException("This failed: ") << reason << raise;

It is always necessary to use either SlHelpers::raise, or raise() to throw, or getRE() to obtain the exception.


The documentation for this class was generated from the following file: