Loading...
Searching...
No Matches
Go to the documentation of this file.
19 #if defined FAST_RELEASE & defined NDEBUG
21 #define assert_release(ignore_test) ((void)0)
22 #define assert_release_constexpr(ignore_test) ((void)0)
28 #define CODAC_ASSERT_MESSAGE(test, file, line, function) \
30 throw std::invalid_argument( \
31 std::string("\n=============================================================================") \
32 + "\nThe following Codac assertion failed:\n\n\t" + std::string(test) \
33 + "\n\nIn: " + std::string(file) + ":" + std::to_string(line) \
34 + "\nFunction: " + std::string(function) \
35 + "\nYou need help? Submit an issue on: https://github.com/codac-team/codac/issues" \
36 + "\n=============================================================================" \
40 #if defined(__PRETTY_FUNCTION__)
42 #define assert_release(test) \
45 CODAC_ASSERT_MESSAGE(#test, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
49 #define assert_release_constexpr(test) \
51 if constexpr(!(test)) { \
52 CODAC_ASSERT_MESSAGE(#test, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
58 #define assert_release(test) \
61 CODAC_ASSERT_MESSAGE(#test, __FILE__, __LINE__, __func__); \
65 #define assert_release_constexpr(test) \
67 if constexpr(!(test)) { \
68 CODAC_ASSERT_MESSAGE(#test, __FILE__, __LINE__, __func__); \
79 #define assert_release(test) \
82 auto l = std::source_location::current(); \
83 std::ostringstream s; \
84 s << l.file_name() << '(' \
86 << l.column() << ")\n " \
87 << l.function_name() << "\n"; \
88 throw std::invalid_argument("Wrong assertion in the following function:\n " + s.str()); \