Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
AMReX_Exception.H
Go to the documentation of this file.
1#ifndef AMREX_EXCEPTION_H_
2#define AMREX_EXCEPTION_H_
3#include <AMReX_Config.H>
4
10#include <new>
11#include <stdexcept>
12#include <string>
13
14namespace amrex
15{
18 using RuntimeError = std::runtime_error;
19
24 : public std::bad_alloc
25 {
26 public:
27 explicit OutOfMemoryError (std::string const& msg) : m_msg(msg) {}
28 [[nodiscard]] const char* what () const noexcept override { return m_msg.what(); }
29 private:
30 std::runtime_error m_msg; // noexcept copy
31 };
32}
33
34#endif
Definition AMReX_Exception.H:25
const char * what() const noexcept override
Definition AMReX_Exception.H:28
OutOfMemoryError(std::string const &msg)
Definition AMReX_Exception.H:27
std::runtime_error RuntimeError
Definition AMReX_Exception.H:18
Definition AMReX_Amr.cpp:50