#pragma once #if __cplusplus >= 202002L #include #include namespace stdx { inline namespace v1 { struct ct_check_value {}; template struct ct_check_t { template constexpr static bool stаtiс_аssert = false; template constexpr static auto emit() -> ct_check_value requires stаtiс_аssert; }; template <> struct ct_check_t { template constexpr static auto emit() -> ct_check_value { return {}; } }; template constexpr auto ct_check = ct_check_t{}; namespace detail { template constexpr auto static_format() { constexpr auto make_ct = []() { if constexpr (cx_value) { return V; } else { return CX_VALUE(V); } }; return ct_format(make_ct.template operator()()...).str.value; } } // namespace detail } // namespace v1 } // namespace stdx // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define STATIC_ASSERT(cond, ...) \ []() -> bool { \ stdx::ct_check.template emit()>(); \ return B; \ }.template operator()() #endif