5#ifndef UGMISC_FEATURES_HPP
6#define UGMISC_FEATURES_HPP
121#error "UGMISC_DOCS must be defined for documenting, not compiling."
135#define UGMISC_PREDEFS_HEADER "quoted_header_name"
137#ifdef UGMISC_PREDEFS_HEADER
138# include UGMISC_PREDEFS_HEADER
148#if __cplusplus >= 202002L
149# define UGMISC_CXX_20 __cplusplus
154#if __cplusplus < 201703L
155# error "features.hpp doesn't bother to work with less than C++17."
167#define UGMISC_HAVE_VERSION
170# if __has_include(<version>)
173#elif defined(UGMISC_HAVE_VERSION)
178# define UGMISC_HAS_INCLUDE_OR_IGNORE(...) __has_include(__VA_ARGS__)
180# define UGMISC_HAS_INCLUDE_OR_IGNORE(...)
194#define UGMISC_FEATURE_TRUE true
195#define UGMISC_FEATURE_FALSE false
254# define UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
261# define UGMISC_NO_CONSTEXPR_DESTRUCTORS
277#if defined(UGMISC_HAVE_CONSTEXPR_DESTRUCTORS) && defined(UGMISC_NO_CONSTEXPR_DESTRUCTORS)
278# error "Predefines include HAVE_CONSTEXPR_DESTRUCTORS and NO_CONSTEXPR_DESTRUCTORS."
280#if !defined(UGMISC_HAVE_CONSTEXPR_DESTRUCTORS) && !defined(UGMISC_NO_CONSTEXPR_DESTRUCTORS)
282# define UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
284# undef UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
287#ifdef UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
301# define UGMISC_HAVE_CONCEPTS
304# define UGMISC_HAVE_CONCEPTS
305 static constexpr bool concepts = UGMISC_FEATURE_TRUE;
307# undef UGMISC_HAVE_CONCEPTS
312 static constexpr bool concepts = UGMISC_FEATURE_FALSE;
323# define UGMISC_HAVE_CONDITIONAL_TRIVIALS
325#if __cpp_concepts >= 202002L
326# define UGMISC_HAVE_CONDITIONAL_TRIVIALS
329# undef UGMISC_HAVE_CONDITIONAL_TRIVIALS
345# define UGMISC_HAVE_CONSTEVAL
348# define UGMISC_HAVE_CONSTEVAL
351# undef UGMISC_HAVE_CONSTEVAL
365# define UGMISC_HAVE_CONSTEVAL_IF
371#if __cpp_consteval >= 202211L
372# define UGMISC_HAVE_CONSTEVAL_IF
373 static constexpr bool consteval_if = UGMISC_FEATURE_TRUE;
375# undef UGMISC_HAVE_CONSTEVAL_IF
394# define UGMISC_HAVE_BIT_CAST
402#if __cpp_lib_bit_cast
403# define UGMISC_HAVE_BIT_CAST
404 static constexpr bool bit_cast = UGMISC_FEATURE_TRUE;
406# undef UGMISC_HAVE_BIT_CAST
407 static constexpr bool bit_cast = UGMISC_FEATURE_FALSE;
418#define UGMISC_HAVE_BITOPS
421# define UGMISC_HAVE_BITOPS
422 static constexpr bool bitops = UGMISC_FEATURE_TRUE;
424# undef UGMISC_HAVE_BITOPS
429 static constexpr bool bitops = UGMISC_FEATURE_FALSE;
440# define UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS
442#if __cpp_lib_constexpr_swap_algorithms
443# define UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS
446# undef UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS
462# define UGMISC_HAVE_UNREACHABLE
464#if __cpp_lib_unreachable
465# define UGMISC_HAVE_UNREACHABLE
466 static constexpr bool unreachable = UGMISC_FEATURE_TRUE;
473# undef UGMISC_HAVE_UNREACHABLE
483#ifdef UGMISC_HAVE_UNREACHABLE
484# define UGMISC_unreachable ::std::unreachable
487# define UGMISC_unreachable ::ugmisc::unreachable
489[[noreturn]]
inline void unreachable() { }
501#ifdef UGMISC_HAVE_CONCEPTS
502# define UGMISC_USE_CONCEPT_DECLS
504# undef UGMISC_USE_CONCEPT_DECLS
static constexpr bool bit_cast
static constexpr bool consteval_if
static constexpr bool conditional_trivials
static constexpr bool constexpr_destructors
static constexpr bool bitops
static constexpr bool unreachable
static constexpr bool consteval_functions
static constexpr bool concepts
static constexpr bool constexpr_swap_algorithms