133#error "UGMISC_DOCS must be defined for documenting, not compiling."
147#define UGMISC_PREDEFS_HEADER "quoted_header_name"
149#ifdef UGMISC_PREDEFS_HEADER
150# include UGMISC_PREDEFS_HEADER
160#if __cplusplus >= 202002L
161# define UGMISC_CXX_20 __cplusplus
166#if __cplusplus < 201703L
167# error "features.hpp doesn't bother to work with less than C++17."
179#define UGMISC_HAVE_VERSION
182# if __has_include(<version>)
185#elif defined(UGMISC_HAVE_VERSION)
190# define UGMISC_HAS_INCLUDE_OR_IGNORE(...) __has_include(__VA_ARGS__)
192# define UGMISC_HAS_INCLUDE_OR_IGNORE(...)
206#define UGMISC_FEATURE_TRUE true
207#define UGMISC_FEATURE_FALSE false
266# define UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
273# define UGMISC_NO_CONSTEXPR_DESTRUCTORS
289#if defined(UGMISC_HAVE_CONSTEXPR_DESTRUCTORS) && defined(UGMISC_NO_CONSTEXPR_DESTRUCTORS)
290# error "Predefines include HAVE_CONSTEXPR_DESTRUCTORS and NO_CONSTEXPR_DESCTRUCTORS."
292#if !defined(UGMISC_HAVE_CONSTEXPR_DESTRUCTORS) && !defined(UGMISC_NO_CONSTEXPR_DESTRUCTORS)
294# define UGMISC_HAVE_CONSTEXPR_DESCTRUCTORS
296# undef UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
299#ifdef UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
313# define UGMISC_HAVE_CONSTEVAL
316# define UGMISC_HAVE_CONSTEVAL
319# undef UGMISC_HAVE_CONSTEVAL
333# define UGMISC_HAVE_CONSTEVAL_IF
339#if __cpp_consteval >= 202211L
340# define UGMISC_HAVE_CONSTEVAL_IF
341 static constexpr bool consteval_if = UGMISC_FEATURE_TRUE;
343# undef UGMISC_HAVE_CONSTEVAL_IF
362# define UGMISC_HAVE_BIT_CAST
370#if __cpp_lib_bit_cast
371# define UGMISC_HAVE_BIT_CAST
372 static constexpr bool bit_cast = UGMISC_FEATURE_TRUE;
374# undef UGMISC_HAVE_BIT_CAST
375 static constexpr bool bit_cast = UGMISC_FEATURE_FALSE;
386#define UGMISC_HAVE_BITOPS
389# define UGMISC_HAVE_BITOPS
390 static constexpr bool bitops = UGMISC_FEATURE_TRUE;
392# undef UGMISC_HAVE_BITOPS
397 static constexpr bool bitops = UGMISC_FEATURE_FALSE;
408# define UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS
410#if __cpp_lib_constexpr_swap_algorithms
411# define UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS
414# undef UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS
430# define UGMISC_HAVE_UNREACHABLE
432#if __cpp_lib_unreachable
433# define UGMISC_HAVE_UNREACHABLE
434# define UGMISC_UNREACHABLE std::unreachable();
435 static constexpr bool unreachable = UGMISC_FEATURE_TRUE;
442# undef UGMISC_HAVE_UNREACHABLE
452#ifdef UGMISC_HAVE_UNREACHABLE
453# define UGMISC_unreachable std::unreachable
456# define UGMISC_unreachable ::ugmisc::unreachable
457[[noreturn]]
inline void unreachable() { }
Definition features.hpp:250
static constexpr bool bit_cast
Definition features.hpp:375
static constexpr bool consteval_if
Definition features.hpp:344
static constexpr bool constexpr_destructors
Definition features.hpp:300
static constexpr bool bitops
Definition features.hpp:397
static constexpr bool unreachable
Definition features.hpp:441
static constexpr bool consteval_functions
Definition features.hpp:324
static constexpr bool constexpr_swap_algorithms
Definition features.hpp:419