127#error "UGMISC_DOCS must be defined for documenting, not compiling."
141#define UGMISC_PREDEFS_HEADER "quoted_header_name"
143#ifdef UGMISC_PREDEFS_HEADER
144# include UGMISC_PREDEFS_HEADER
154#if __cplusplus >= 202002L
155# define UGMISC_CXX_20 __cplusplus
160#if __cplusplus < 201703L
161# error "features.hpp doesn't bother to work with less than C++17."
173#define UGMISC_HAVE_VERSION
176# if __has_include(<version>)
179#elif defined(UGMISC_HAVE_VERSION)
184# define UGMISC_HAS_INCLUDE_OR_IGNORE(...) __has_include(__VA_ARGS__)
186# define UGMISC_HAS_INCLUDE_OR_IGNORE(...)
200#define UGMISC_FEATURE_TRUE true
201#define UGMISC_FEATURE_FALSE false
260# define UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
267# define UGMISC_NO_CONSTEXPR_DESTRUCTORS
283#if defined(UGMISC_HAVE_CONSTEXPR_DESTRUCTORS) && defined(UGMISC_NO_CONSTEXPR_DESTRUCTORS)
284# error "Predefines include HAVE_CONSTEXPR_DESTRUCTORS and NO_CONSTEXPR_DESCTRUCTORS."
286#if !defined(UGMISC_HAVE_CONSTEXPR_DESTRUCTORS) && !defined(UGMISC_NO_CONSTEXPR_DESTRUCTORS)
288# define UGMISC_HAVE_CONSTEXPR_DESCTRUCTORS
290# undef UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
293#ifdef UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
307# define UGMISC_HAVE_CONSTEVAL
310# define UGMISC_HAVE_CONSTEVAL
313# undef UGMISC_HAVE_CONSTEVAL
327# define UGMISC_HAVE_CONSTEVAL_IF
333#if __cpp_consteval >= 202211L
334# define UGMISC_HAVE_CONSTEVAL_IF
335 static constexpr bool consteval_if = UGMISC_FEATURE_TRUE;
337# undef UGMISC_HAVE_CONSTEVAL_IF
356# define UGMISC_HAVE_BIT_CAST
364#if __cpp_lib_bit_cast
365# define UGMISC_HAVE_BIT_CAST
366 static constexpr bool bit_cast = UGMISC_FEATURE_TRUE;
368# undef UGMISC_HAVE_BIT_CAST
369 static constexpr bool bit_cast = UGMISC_FEATURE_FALSE;
380#define UGMISC_HAVE_BITOPS
383# define UGMISC_HAVE_BITOPS
384 static constexpr bool bitops = UGMISC_FEATURE_TRUE;
386# undef UGMISC_HAVE_BITOPS
391 static constexpr bool bitops = UGMISC_FEATURE_FALSE;
402# define UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS
404#if __cpp_lib_constexpr_swap_algorithms
405# define UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS
408# undef UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS
424# define UGMISC_HAVE_UNREACHABLE
426#if __cpp_lib_unreachable
427# define UGMISC_HAVE_UNREACHABLE
428# define UGMISC_UNREACHABLE std::unreachable();
429 static constexpr bool unreachable = UGMISC_FEATURE_TRUE;
436# undef UGMISC_HAVE_UNREACHABLE
446#ifdef UGMISC_HAVE_UNREACHABLE
447# define UGMISC_unreachable std::unreachable
450# define UGMISC_unreachable ::ugmisc::unreachable
451[[noreturn]]
inline void unreachable() { }
Definition features.hpp:244
static constexpr bool bit_cast
Definition features.hpp:369
static constexpr bool consteval_if
Definition features.hpp:338
static constexpr bool constexpr_destructors
Definition features.hpp:294
static constexpr bool bitops
Definition features.hpp:391
static constexpr bool unreachable
Definition features.hpp:435
static constexpr bool consteval_functions
Definition features.hpp:318
static constexpr bool constexpr_swap_algorithms
Definition features.hpp:413