utilities for custom assertions More...
#include "config.hpp"#include <stdexcept>#include <vector>#include <string>#include <omp.h>#include "format_str.hpp"Classes | |
| class | hexed::assert::Exception |
| class | hexed::assert::Numerical_exception |
| Represents a fatal problem in the numerics of the code (such as nonphysical values) More... | |
| class | hexed::assert::User_error |
| Represents an exception which clearly results from a mistake made by the user. More... | |
| class | hexed::assert::Not_implemented_error |
| Indicates that the user invoked functionality which should be implemented in the future but isn't yet. More... | |
| class | hexed::assert::Internal_error |
| Indicates that a situation has been encountered which should not be possible, regardless of user input. More... | |
| class | hexed::assert::Overflow_error |
| Indicates an exception caused by some kind of fixed-size resource has been exhausted. More... | |
Namespaces | |
| namespace | hexed |
| Global namespace for all of the C++ API of Hexed. | |
| namespace | hexed::assert |
| utilities for custom assertions | |
Macros | |
| #define | HEXED_THROW(message, ...) |
| Throws an exception with an informative error message. | |
| #define | HEXED_ASSERT(expression, message, ...) |
| Assert something with an informative error message. | |
Functions | |
| template<typename except_t = Internal_error> | |
| void | hexed::assert::throw_critical (const char *message) |
utilities for custom assertions
| #define HEXED_ASSERT | ( | expression, | |
| message, | |||
| ... ) |
Assert something with an informative error message.
If expression is false, throws an exception with HEXED_THROW. message and an optional third argument are passed to HEXED_THROW.
{}, so it does not require a ; after it. | #define HEXED_THROW | ( | message, | |
| ... ) |
Throws an exception with an informative error message.
Throws an exception with a message that includes message plus some additional info for debugging. Works inside single-threaded regions as well as OpenMP parallel regions. If desired, supply the type of exception as the third argument. Exception type must be constructible from a string. Defaults to std::runtime_error.
{}, so it does not require a ; after it.