38 std::string
str()
const {
return m_oss.str(); }
41 auto getRE()
const {
return std::runtime_error(str()); }
44 [[noreturn]]
void raise()
const {
throw getRE(); }
50 std::ostringstream m_oss;
53 inline constexpr RuntimeException::ThrowNow
raise;
Class for easier construction of std::runtime_error.
Definition: Exception.h:22
Definition: Exception.h:28
RuntimeException(std::string_view str)
Construct new RuntimeException, having str as the initial exception string.
Definition: Exception.h:26
void operator<<(const ThrowNow &)
Create and throw std::runtime_error.
Definition: Exception.h:47
auto getRE() const
Create and return std::runtime_error.
Definition: Exception.h:41
RuntimeException & operator<<(const T &msg)
Add more to the exception string.
Definition: Exception.h:32
std::string str() const
Return the stored exception string.
Definition: Exception.h:38