Код: Выделить всё
/* Licenses: allows all uses ("Creative Commons"/"Apache 2") */
#ifndef INCLUDE_GUARD_cxx_Macros_hxx
#define INCLUDE_GUARD_cxx_Macros_hxx
/* Miscellaneous macros */
#include /* assert static_assert */
#include /* false */
#include /* __cpp_lib_unreachable */ /* [https://en.cppreference.com/w/cpp/feature_test] */
#if (defined DEBUG) && (defined static_assert)
#define UNREACHABLE static_assert(false)
#elif defined DEBUG
#define UNREACHABLE assert(false)
#elif __cpp_lib_unreachable
/* `UNREACHABLE` is close to `ASSUME(false)` */
/* Promises executable can not reach this spot, allows extra optimizations. Warning: `UNREACHABLE && UB (undefined behaviour)` */
#include /* std::unreachable() */
#define UNREACHABLE std::unreachable()
#elif (defined __GNUC__) && ((4
Подробнее здесь: [url]https://stackoverflow.com/questions/78531276/how-to-do-c-contracts-such-that-compilers-can-use-once-support-comes-for-this[/url]