24#ifndef UGMISC_FEATURES_HPP
25#define UGMISC_FEATURES_HPP
136#error "UGMISC_DOCS must be defined for documenting, not compiling."
150#define UGMISC_PREDEFS_HEADER "quoted_header_name"
152#ifdef UGMISC_PREDEFS_HEADER
153# include UGMISC_PREDEFS_HEADER
163#if __cplusplus >= 202002L
164# define UGMISC_CXX_20 __cplusplus
169#if __cplusplus < 201703L
170# error "features.hpp doesn't bother to work with less than C++17."
182#define UGMISC_HAVE_VERSION
185# if __has_include(<version>)
188#elif defined(UGMISC_HAVE_VERSION)
193# define UGMISC_HAS_INCLUDE_OR_IGNORE(...) __has_include(__VA_ARGS__)
195# define UGMISC_HAS_INCLUDE_OR_IGNORE(...)
209#define UGMISC_FEATURE_TRUE true
210#define UGMISC_FEATURE_FALSE false
269# define UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
276# define UGMISC_NO_CONSTEXPR_DESTRUCTORS
292#if defined(UGMISC_HAVE_CONSTEXPR_DESTRUCTORS) && defined(UGMISC_NO_CONSTEXPR_DESTRUCTORS)
293# error "Predefines include HAVE_CONSTEXPR_DESTRUCTORS and NO_CONSTEXPR_DESTRUCTORS."
295#if !defined(UGMISC_HAVE_CONSTEXPR_DESTRUCTORS) && !defined(UGMISC_NO_CONSTEXPR_DESTRUCTORS)
297# define UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
299# undef UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
302#ifdef UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
316# define UGMISC_HAVE_CONCEPTS
319# define UGMISC_HAVE_CONCEPTS
320 static constexpr bool concepts = UGMISC_FEATURE_TRUE;
322# undef UGMISC_HAVE_CONCEPTS
327 static constexpr bool concepts = UGMISC_FEATURE_FALSE;
338# define UGMISC_HAVE_CONDITIONAL_TRIVIALS
340#if __cpp_concepts >= 202002L
341# define UGMISC_HAVE_CONDITIONAL_TRIVIALS
344# undef UGMISC_HAVE_CONDITIONAL_TRIVIALS
360# define UGMISC_HAVE_CONSTEVAL
363# define UGMISC_HAVE_CONSTEVAL
366# undef UGMISC_HAVE_CONSTEVAL
380# define UGMISC_HAVE_CONSTEVAL_IF
386#if __cpp_consteval >= 202211L
387# define UGMISC_HAVE_CONSTEVAL_IF
388 static constexpr bool consteval_if = UGMISC_FEATURE_TRUE;
390# undef UGMISC_HAVE_CONSTEVAL_IF
409# define UGMISC_HAVE_BIT_CAST
417#if __cpp_lib_bit_cast
418# define UGMISC_HAVE_BIT_CAST
419 static constexpr bool bit_cast = UGMISC_FEATURE_TRUE;
421# undef UGMISC_HAVE_BIT_CAST
422 static constexpr bool bit_cast = UGMISC_FEATURE_FALSE;
433#define UGMISC_HAVE_BITOPS
436# define UGMISC_HAVE_BITOPS
437 static constexpr bool bitops = UGMISC_FEATURE_TRUE;
439# undef UGMISC_HAVE_BITOPS
444 static constexpr bool bitops = UGMISC_FEATURE_FALSE;
455# define UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS
457#if __cpp_lib_constexpr_swap_algorithms
458# define UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS
461# undef UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS
477# define UGMISC_HAVE_UNREACHABLE
479#if __cpp_lib_unreachable
480# define UGMISC_HAVE_UNREACHABLE
481 static constexpr bool unreachable = UGMISC_FEATURE_TRUE;
488# undef UGMISC_HAVE_UNREACHABLE
498#ifdef UGMISC_HAVE_UNREACHABLE
499# define UGMISC_unreachable ::std::unreachable
502# define UGMISC_unreachable ::ugmisc::unreachable
504[[noreturn]]
inline void unreachable() { }
516#ifdef UGMISC_HAVE_CONCEPTS
517# define UGMISC_USE_CONCEPT_DECLS
519# undef UGMISC_USE_CONCEPT_DECLS
Definition features.hpp:253
static constexpr bool bit_cast
Definition features.hpp:422
static constexpr bool consteval_if
Definition features.hpp:391
static constexpr bool conditional_trivials
Definition features.hpp:349
static constexpr bool constexpr_destructors
Definition features.hpp:303
static constexpr bool bitops
Definition features.hpp:444
static constexpr bool unreachable
Definition features.hpp:487
static constexpr bool consteval_functions
Definition features.hpp:371
static constexpr bool concepts
Definition features.hpp:327
static constexpr bool constexpr_swap_algorithms
Definition features.hpp:466