123#error "UGMISC_DOCS must be defined for documenting, not compiling."
137#define UGMISC_PREDEFS_HEADER "quoted_header_name"
139#ifdef UGMISC_PREDEFS_HEADER
140# include UGMISC_PREDEFS_HEADER
150#if __cplusplus >= 202002L
151# define UGMISC_CXX_20 __cplusplus
156#if __cplusplus < 201703L
157# error "features.hpp doesn't bother to work with less than C++17."
169#define UGMISC_HAVE_VERSION
172# if __has_include(<version>)
175#elif defined(UGMISC_HAVE_VERSION)
180# define UGMISC_HAS_INCLUDE_OR_IGNORE(...) __has_include(__VA_ARGS__)
182# define UGMISC_HAS_INCLUDE_OR_IGNORE(...)
196#define UGMISC_FEATURE_TRUE true
197#define UGMISC_FEATURE_FALSE false
256# define UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
263# define UGMISC_NO_CONSTEXPR_DESTRUCTORS
279#if defined(UGMISC_HAVE_CONSTEXPR_DESTRUCTORS) && defined(UGMISC_NO_CONSTEXPR_DESTRUCTORS)
280# error "Predefines include HAVE_CONSTEXPR_DESTRUCTORS and NO_CONSTEXPR_DESCTRUCTORS."
282#if !defined(UGMISC_HAVE_CONSTEXPR_DESTRUCTORS) && !defined(UGMISC_NO_CONSTEXPR_DESTRUCTORS)
284# define UGMISC_HAVE_CONSTEXPR_DESCTRUCTORS
286# undef UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
289#ifdef UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
303# define UGMISC_HAVE_CONSTEVAL
306# define UGMISC_HAVE_CONSTEVAL
309# undef UGMISC_HAVE_CONSTEVAL
323# define UGMISC_HAVE_CONSTEVAL_IF
329#if __cpp_consteval >= 202211L
330# define UGMISC_HAVE_CONSTEVAL_IF
331 static constexpr bool consteval_if = UGMISC_FEATURE_TRUE;
333# undef UGMISC_HAVE_CONSTEVAL_IF
352# define UGMISC_HAVE_BIT_CAST
360#if __cpp_lib_bit_cast
361# define UGMISC_HAVE_BIT_CAST
362 static constexpr bool bit_cast = UGMISC_FEATURE_TRUE;
364# undef UGMISC_HAVE_BIT_CAST
365 static constexpr bool bit_cast = UGMISC_FEATURE_FALSE;
376#define UGMISC_HAVE_BITOPS
379# define UGMISC_HAVE_BITOPS
380 static constexpr bool bitops = UGMISC_FEATURE_TRUE;
382# undef UGMISC_HAVE_BITOPS
387 static constexpr bool bitops = UGMISC_FEATURE_FALSE;
398# define UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS
400#if __cpp_lib_constexpr_swap_algorithms
401# define UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS
404# undef UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS
420# define UGMISC_HAVE_UNREACHABLE
422#if __cpp_lib_unreachable
423# define UGMISC_HAVE_UNREACHABLE
424# define UGMISC_UNREACHABLE std::unreachable();
425 static constexpr bool unreachable = UGMISC_FEATURE_TRUE;
432# undef UGMISC_HAVE_UNREACHABLE
442#ifdef UGMISC_HAVE_UNREACHABLE
443# define UGMISC_unreachable std::unreachable
446# define UGMISC_unreachable ::ugmisc::unreachable
447[[noreturn]]
inline void unreachable() { }
Definition features.hpp:240
static constexpr bool bit_cast
Definition features.hpp:365
static constexpr bool consteval_if
Definition features.hpp:334
static constexpr bool constexpr_destructors
Definition features.hpp:290
static constexpr bool bitops
Definition features.hpp:387
static constexpr bool unreachable
Definition features.hpp:431
static constexpr bool consteval_functions
Definition features.hpp:314
static constexpr bool constexpr_swap_algorithms
Definition features.hpp:409