Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 09:44:53

0001 // Copyright 2020-2023 Daniel Lemire
0002 // Copyright 2023 Matt Borland
0003 // Distributed under the Boost Software License, Version 1.0.
0004 // https://www.boost.org/LICENSE_1_0.txt
0005 //
0006 // Derivative of: https://github.com/fastfloat/fast_float
0007 
0008 #ifndef BOOST_CHARCONV_DETAIL_FASTFLOAT_CONSTEXPR_FEATURE_DETECT_HPP
0009 #define BOOST_CHARCONV_DETAIL_FASTFLOAT_CONSTEXPR_FEATURE_DETECT_HPP
0010 
0011 #ifdef __has_include
0012 #if __has_include(<version>)
0013 #include <version>
0014 #endif
0015 #endif
0016 
0017 // Testing for https://wg21.link/N3652, adopted in C++14
0018 #if __cpp_constexpr >= 201304
0019 #define BOOST_CHARCONV_FASTFLOAT_CONSTEXPR14 constexpr
0020 #else
0021 #define BOOST_CHARCONV_FASTFLOAT_CONSTEXPR14
0022 #endif
0023 
0024 #if defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806L
0025 #define BOOST_CHARCONV_FASTFLOAT_HAS_BIT_CAST 1
0026 #else
0027 #define BOOST_CHARCONV_FASTFLOAT_HAS_BIT_CAST 0
0028 #endif
0029 
0030 #if defined(__cpp_lib_is_constant_evaluated) && __cpp_lib_is_constant_evaluated >= 201811L
0031 #define BOOST_CHARCONV_FASTFLOAT_HAS_IS_CONSTANT_EVALUATED 1
0032 #else
0033 #define BOOST_CHARCONV_FASTFLOAT_HAS_IS_CONSTANT_EVALUATED 0
0034 #endif
0035 
0036 // Testing for relevant C++20 constexpr library features
0037 #if BOOST_CHARCONV_FASTFLOAT_HAS_IS_CONSTANT_EVALUATED \
0038     && BOOST_CHARCONV_FASTFLOAT_HAS_BIT_CAST \
0039     && __cpp_lib_constexpr_algorithms >= 201806L /*For std::copy and std::fill*/
0040 #define BOOST_CHARCONV_FASTFLOAT_CONSTEXPR20 constexpr
0041 #define BOOST_CHARCONV_FASTFLOAT_IS_CONSTEXPR 1
0042 #else
0043 #define BOOST_CHARCONV_FASTFLOAT_CONSTEXPR20
0044 #define BOOST_CHARCONV_FASTFLOAT_IS_CONSTEXPR 0
0045 #endif
0046 
0047 #endif // BOOST_CHARCONV_FASTFLOAT_CONSTEXPR_FEATURE_DETECT_H