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;
28[[noreturn]]
void AbortWithStacktrace(std::string_view message)
noexcept;
39#define UASSERT_MSG(expr, msg)
41 if (USERVER_NAMESPACE
::utils::impl::kEnableAssert) {
44 USERVER_NAMESPACE
::utils::impl::UASSERT_failed(
45 #expr, __FILE__, __LINE__, __func__, msg);
61#define UINVARIANT(condition, message)
65 if constexpr (USERVER_NAMESPACE
::utils::impl::kEnableAssert) {
66 USERVER_NAMESPACE
::utils::impl::UASSERT_failed(
67 #condition, __FILE__, __LINE__, __func__, message);
69 USERVER_NAMESPACE
::utils::impl::LogAndThrowInvariantError(#condition,