JayBeams
0.1
Another project to have fun coding.
jb
assert_throw.hpp
Go to the documentation of this file.
1
#ifndef jb_assert_throw_hpp
2
#define jb_assert_throw_hpp
3
4
#include <stdexcept>
5
6
namespace
jb
{
7
8
/**
9
* Raise std::exception to indicate an assertion failure
10
*/
11
[[noreturn]]
void
raise_assertion_failure
(
12
char
const
* filename,
int
lineno,
char
const
* predicate);
13
14
#define JB_ASSERT_THROW(PRED) \
15
do { \
16
if (not(PRED)) { \
17
::jb::raise_assertion_failure(__FILE__, __LINE__, #PRED); \
18
} \
19
} while (false)
20
21
}
// namespace jb
22
23
#endif // jb_assert_throw_hpp
jb::raise_assertion_failure
void raise_assertion_failure(char const *filename, int lineno, char const *predicate)
Raise std::exception to indicate an assertion failure.
Definition:
assert_throw.cpp:6
jb
The top-level namespace for the JayBeams library.
Definition:
as_hhmmss.hpp:7
Generated by
1.8.13