11namespace utils::impl {
13[[noreturn]]
void UASSERT_failed(
14 std::string_view expr,
21[[noreturn]]
void LogAndThrowInvariantError(std::string_view condition, std::string_view message);
24inline constexpr bool kEnableAssert =
false;
26inline constexpr bool kEnableAssert =
true;
29extern bool dump_stacktrace_on_assert_failure;
31[[noreturn]]
void AbortWithStacktrace(std::string_view message)
noexcept;
42#define UASSERT_MSG(expr, msg)
44 if (USERVER_NAMESPACE
::utils::impl::kEnableAssert) {
47 USERVER_NAMESPACE
::utils::impl::UASSERT_failed(#expr, __FILE__, __LINE__, __func__, msg);
63#define UINVARIANT(condition, message)
67 if constexpr (USERVER_NAMESPACE
::utils::impl::kEnableAssert) {
68 USERVER_NAMESPACE
::utils::impl::UASSERT_failed(#condition, __FILE__, __LINE__, __func__, message);
70 USERVER_NAMESPACE
::utils::impl::LogAndThrowInvariantError(#condition, message);