// // Created by erki on 29.06.22. // #include "utility_assert.hpp" #include namespace { Utility::Assert::assert_cb INSTALLED_HANDLER = nullptr; } namespace Utility::Assert { namespace Detail { void assertImpl(const bool expr, const char* file, const int line) { if (!expr) { if (INSTALLED_HANDLER) INSTALLED_HANDLER(file, line); else std::terminate(); } } } void setHandler(assert_cb callback) { INSTALLED_HANDLER = callback; } assert_cb getHandler() { return INSTALLED_HANDLER; } }