11namespace utils::impl {
13[[noreturn]]
void UASSERT_failed(std::string_view expr,
const char* file,
14 unsigned int line,
const char* function,
15 std::string_view msg)
noexcept;
17[[noreturn]]
void LogAndThrowInvariantError(std::string_view condition,
18 std::string_view message);
21inline constexpr bool kEnableAssert =
false;
23inline constexpr bool kEnableAssert =
true;
26extern bool dump_stacktrace_on_assert_failure;
37#define UASSERT_MSG(expr, msg)
39 if (USERVER_NAMESPACE
::utils::impl::kEnableAssert) {
42 USERVER_NAMESPACE
::utils::impl::UASSERT_failed(
43 #expr, __FILE__, __LINE__, __func__, msg);
59#define UINVARIANT(condition, message)
63 if constexpr (USERVER_NAMESPACE
::utils::impl::kEnableAssert) {
64 USERVER_NAMESPACE
::utils::impl::UASSERT_failed(
65 #condition, __FILE__, __LINE__, __func__, message);
67 USERVER_NAMESPACE
::utils::impl::LogAndThrowInvariantError(#condition,