5#ifndef UGMISC_FEATURES_HPP
6#define UGMISC_FEATURES_HPP
117#error "UGMISC_DOCS must be defined for documenting, not compiling."
131#define UGMISC_PREDEFS_HEADER "quoted_header_name"
133#ifdef UGMISC_PREDEFS_HEADER
134# include UGMISC_PREDEFS_HEADER
144#if __cplusplus >= 202002L
145# define UGMISC_CXX_20 __cplusplus
150#if __cplusplus < 201703L
151# error "features.hpp doesn't bother to work with less than C++17."
163#define UGMISC_HAVE_VERSION
166# if __has_include(<version>)
169#elif defined(UGMISC_HAVE_VERSION)
174# define UGMISC_HAS_INCLUDE_OR_IGNORE(...) __has_include(__VA_ARGS__)
176# define UGMISC_HAS_INCLUDE_OR_IGNORE(...)
190#define UGMISC_FEATURE_TRUE true
191#define UGMISC_FEATURE_FALSE false
250# define UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
257# define UGMISC_NO_CONSTEXPR_DESTRUCTORS
273#if defined(UGMISC_HAVE_CONSTEXPR_DESTRUCTORS) && defined(UGMISC_NO_CONSTEXPR_DESTRUCTORS)
274# error "Predefines include HAVE_CONSTEXPR_DESTRUCTORS and NO_CONSTEXPR_DESTRUCTORS."
276#if !defined(UGMISC_HAVE_CONSTEXPR_DESTRUCTORS) && !defined(UGMISC_NO_CONSTEXPR_DESTRUCTORS)
278# define UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
280# undef UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
283#ifdef UGMISC_HAVE_CONSTEXPR_DESTRUCTORS
297# define UGMISC_HAVE_CONCEPTS
300# define UGMISC_HAVE_CONCEPTS
301 static constexpr bool concepts = UGMISC_FEATURE_TRUE;
303# undef UGMISC_HAVE_CONCEPTS
308 static constexpr bool concepts = UGMISC_FEATURE_FALSE;
319# define UGMISC_HAVE_CONDITIONAL_TRIVIALS
321#if __cpp_concepts >= 202002L
322# define UGMISC_HAVE_CONDITIONAL_TRIVIALS
325# undef UGMISC_HAVE_CONDITIONAL_TRIVIALS
341# define UGMISC_HAVE_CONSTEVAL
344# define UGMISC_HAVE_CONSTEVAL
347# undef UGMISC_HAVE_CONSTEVAL
361# define UGMISC_HAVE_CONSTEVAL_IF
367#if __cpp_consteval >= 202211L
368# define UGMISC_HAVE_CONSTEVAL_IF
369 static constexpr bool consteval_if = UGMISC_FEATURE_TRUE;
371# undef UGMISC_HAVE_CONSTEVAL_IF
390# define UGMISC_HAVE_BIT_CAST
398#if __cpp_lib_bit_cast
399# define UGMISC_HAVE_BIT_CAST
400 static constexpr bool bit_cast = UGMISC_FEATURE_TRUE;
402# undef UGMISC_HAVE_BIT_CAST
403 static constexpr bool bit_cast = UGMISC_FEATURE_FALSE;
414#define UGMISC_HAVE_BITOPS
417# define UGMISC_HAVE_BITOPS
418 static constexpr bool bitops = UGMISC_FEATURE_TRUE;
420# undef UGMISC_HAVE_BITOPS
425 static constexpr bool bitops = UGMISC_FEATURE_FALSE;
436# define UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS
438#if __cpp_lib_constexpr_swap_algorithms
439# define UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS
442# undef UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS
458# define UGMISC_HAVE_UNREACHABLE
460#if __cpp_lib_unreachable
461# define UGMISC_HAVE_UNREACHABLE
462 static constexpr bool unreachable = UGMISC_FEATURE_TRUE;
469# undef UGMISC_HAVE_UNREACHABLE
479#ifdef UGMISC_HAVE_UNREACHABLE
480# define UGMISC_unreachable ::std::unreachable
483# define UGMISC_unreachable ::ugmisc::unreachable
485[[noreturn]]
inline void unreachable() { }
497#ifdef UGMISC_HAVE_CONCEPTS
498# define UGMISC_USE_CONCEPT_DECLS
500# undef UGMISC_USE_CONCEPT_DECLS
Definition features.hpp:234
static constexpr bool bit_cast
Definition features.hpp:403
static constexpr bool consteval_if
Definition features.hpp:372
static constexpr bool conditional_trivials
Definition features.hpp:330
static constexpr bool constexpr_destructors
Definition features.hpp:284
static constexpr bool bitops
Definition features.hpp:425
static constexpr bool unreachable
Definition features.hpp:468
static constexpr bool consteval_functions
Definition features.hpp:352
static constexpr bool concepts
Definition features.hpp:308
static constexpr bool constexpr_swap_algorithms
Definition features.hpp:447