22class [[nodiscard(
"Exception must be thrown")]] RuntimeException {
24 RuntimeException() =
default;
38 std::string
str()
const {
return m_oss.str(); }
41 auto getRE()
const {
return std::runtime_error(
str()); }
50 std::ostringstream m_oss;
53inline constexpr RuntimeException::ThrowNow raise;
void raise() const
Create and throw std::runtime_error.
Definition Exception.h:44
RuntimeException(std::string_view str)
Construct new RuntimeException, having str as the initial exception string.
Definition Exception.h:26
auto getRE() const
Create and return std::runtime_error.
Definition Exception.h:41
void operator<<(const ThrowNow &)
Create and throw std::runtime_error.
Definition Exception.h:47
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
Definition Exception.h:28