29 #define NOEXCEPT noexcept
43 template<
typename ...Args>
45 static const int MAX_LENGTH = 4*1024;
52 this->message.assign(
out);
64 inline static void check(
const bool condition,
const std::string&
message) {
75 inline static void check(
const bool condition,
const std::string&
message) {
85 template<
typename datatype>
86 inline static void check(
const datatype value,
const datatype
min,
const datatype
max,
const char*
message) {
87 if (value <
min ||
max < value)
91 template<
typename datatype>
115 inline static void check(
const void* pointer,
const char* which) {
145 class DebugAssertion :
public Exception {
147 template<
typename ...Args>
148 inline DebugAssertion(
const std::string& message,
const Args&... args) : Exception(message.c_str(), args...) {}
150 template<
typename ...Args>
151 static inline void check(
const bool condition,
const std::string& message,
const Args&... args) {
153 throw DebugAssertion(message, args...);
161 #define BEATMUP_ASSERT_DEBUG(C) Beatmup::DebugAssertion::check((C), "Debug assertion failed.\n" #C);
163 #define BEATMUP_ASSERT_DEBUG(C)
Base class for all exceptions.
Exception(const char *message)
virtual const char * what() const NOEXCEPT override
Exception(const char *message, const Args &... args)
IOError(const std::string &filename, const char *message)
const std::string & getFilename() const
Exception thrown when an implementation restriction is encountered.
ImplementationUnsupported(const char *description)
Exception thrown when something happens that should never do.
static void insanity(const char *message)
Insanity(const char *message)
static void check(const bool condition, const std::string &message)
InvalidArgument(const char *message, const datatype value)
InvalidArgument(const std::string &message)
static void checkMin(const datatype value, const datatype min, const char *message)
OutOfRange(const char *message, const datatype value)
static void check(const datatype value, const datatype min, const datatype max, const char *message)
RuntimeError(const std::string &message)
static void check(const bool condition, const std::string &message)
CustomPoint< numeric > min(const CustomPoint< numeric > &a, const CustomPoint< numeric > &b)
CustomPoint< numeric > max(const CustomPoint< numeric > &a, const CustomPoint< numeric > &b)