Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:43:38

0001 // Copyright (c) 2016-2023 Antony Polukhin
0002 // Copyright (c) 2022 Denis Mikhailov
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 #ifndef BOOST_PFR_CONFIG_HPP
0008 #define BOOST_PFR_CONFIG_HPP
0009 #pragma once
0010 
0011 #if __cplusplus >= 201402L || (defined(_MSC_VER) && defined(_MSVC_LANG) && _MSC_VER > 1900)
0012 #include <type_traits> // to get non standard platform macro definitions (__GLIBCXX__ for example)
0013 #endif
0014 
0015 /// \file boost/pfr/config.hpp
0016 /// Contains all the macros that describe Boost.PFR configuration, like BOOST_PFR_ENABLED
0017 ///
0018 /// \note This header file doesn't require C++14 Standard and supports all C++ compilers, even pre C++14 compilers (C++11, C++03...).
0019 
0020 // Reminder:
0021 //  * MSVC++ 14.2 _MSC_VER == 1927 <- Loophole is known to work (Visual Studio ????)
0022 //  * MSVC++ 14.1 _MSC_VER == 1916 <- Loophole is known to NOT work (Visual Studio 2017)
0023 //  * MSVC++ 14.0 _MSC_VER == 1900 (Visual Studio 2015)
0024 //  * MSVC++ 12.0 _MSC_VER == 1800 (Visual Studio 2013)
0025 
0026 #ifdef BOOST_PFR_NOT_SUPPORTED
0027 #   error Please, do not set BOOST_PFR_NOT_SUPPORTED value manually, use '-DBOOST_PFR_ENABLED=0' instead of it
0028 #endif
0029 
0030 #if defined(_MSC_VER)
0031 #   if !defined(_MSVC_LANG) || _MSC_VER <= 1900
0032 #       define BOOST_PFR_NOT_SUPPORTED 1
0033 #   endif
0034 #elif __cplusplus < 201402L
0035 #   define BOOST_PFR_NOT_SUPPORTED 1
0036 #endif
0037 
0038 #ifndef BOOST_PFR_USE_LOOPHOLE
0039 #   if defined(_MSC_VER)
0040 #       if _MSC_VER >= 1927
0041 #           define BOOST_PFR_USE_LOOPHOLE 1
0042 #       else
0043 #           define BOOST_PFR_USE_LOOPHOLE 0
0044 #       endif
0045 #   elif defined(__clang_major__) && __clang_major__ >= 8
0046 #       define BOOST_PFR_USE_LOOPHOLE 0
0047 #   else
0048 #       define BOOST_PFR_USE_LOOPHOLE 1
0049 #   endif
0050 #endif
0051 
0052 #ifndef BOOST_PFR_USE_CPP17
0053 #   ifdef __cpp_structured_bindings
0054 #       define BOOST_PFR_USE_CPP17 1
0055 #   elif defined(_MSVC_LANG)
0056 #       if _MSVC_LANG >= 201703L
0057 #           define BOOST_PFR_USE_CPP17 1
0058 #       else
0059 #           define BOOST_PFR_USE_CPP17 0
0060 #       endif
0061 #   else
0062 #       define BOOST_PFR_USE_CPP17 0
0063 #   endif
0064 #endif
0065 
0066 #if (!BOOST_PFR_USE_CPP17 && !BOOST_PFR_USE_LOOPHOLE)
0067 #   if (defined(_MSC_VER) && _MSC_VER < 1916) ///< in Visual Studio 2017 v15.9 PFR library with classic engine normally works
0068 #      define BOOST_PFR_NOT_SUPPORTED 1
0069 #   endif
0070 #endif
0071 
0072 #ifndef BOOST_PFR_USE_STD_MAKE_INTEGRAL_SEQUENCE
0073 // Assume that libstdc++ since GCC-7.3 does not have linear instantiation depth in std::make_integral_sequence
0074 #   if defined( __GLIBCXX__) && __GLIBCXX__ >= 20180101
0075 #       define BOOST_PFR_USE_STD_MAKE_INTEGRAL_SEQUENCE 1
0076 #   elif defined(_MSC_VER)
0077 #       define BOOST_PFR_USE_STD_MAKE_INTEGRAL_SEQUENCE 1
0078 //# elif other known working lib
0079 #   else
0080 #       define BOOST_PFR_USE_STD_MAKE_INTEGRAL_SEQUENCE 0
0081 #   endif
0082 #endif
0083 
0084 #ifndef BOOST_PFR_HAS_GUARANTEED_COPY_ELISION
0085 #   if  defined(__cpp_guaranteed_copy_elision) && (!defined(_MSC_VER) || _MSC_VER > 1928)
0086 #       define BOOST_PFR_HAS_GUARANTEED_COPY_ELISION 1
0087 #   else
0088 #       define BOOST_PFR_HAS_GUARANTEED_COPY_ELISION 0
0089 #   endif
0090 #endif
0091 
0092 #ifndef BOOST_PFR_ENABLE_IMPLICIT_REFLECTION
0093 #   if  defined(__cpp_lib_is_aggregate)
0094 #       define BOOST_PFR_ENABLE_IMPLICIT_REFLECTION 1
0095 #   else
0096 // There is no way to detect potential ability to be reflectable without std::is_aggregare
0097 #       define BOOST_PFR_ENABLE_IMPLICIT_REFLECTION 0
0098 #   endif
0099 #endif
0100 
0101 #ifndef BOOST_PFR_CORE_NAME_ENABLED
0102 #   if  (__cplusplus >= 202002L) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 202002L))
0103 #       if (defined(__cpp_nontype_template_args) && __cpp_nontype_template_args >= 201911) \
0104          || (defined(__clang_major__) && __clang_major__ >= 12)
0105 #           define BOOST_PFR_CORE_NAME_ENABLED 1
0106 #       else
0107 #           define BOOST_PFR_CORE_NAME_ENABLED 0
0108 #       endif
0109 #   else
0110 #       define BOOST_PFR_CORE_NAME_ENABLED 0
0111 #   endif
0112 #endif
0113 
0114 
0115 #ifndef BOOST_PFR_CORE_NAME_PARSING
0116 #   if defined(_MSC_VER) && !defined(__clang__)
0117 #       define BOOST_PFR_CORE_NAME_PARSING (sizeof("auto __cdecl boost::pfr::detail::name_of_field_impl<") - 1, sizeof(">(void) noexcept") - 1, backward("->"))
0118 #   elif defined(__clang__)
0119 #       define BOOST_PFR_CORE_NAME_PARSING (sizeof("auto boost::pfr::detail::name_of_field_impl() [MsvcWorkaround = ") - 1, sizeof("}]") - 1, backward("."))
0120 #   elif defined(__GNUC__)
0121 #       define BOOST_PFR_CORE_NAME_PARSING (sizeof("consteval auto boost::pfr::detail::name_of_field_impl() [with MsvcWorkaround = ") - 1, sizeof(")]") - 1, backward("::"))
0122 #   else
0123 // Default parser for other platforms... Just skip nothing!
0124 #       define BOOST_PFR_CORE_NAME_PARSING (0, 0, "")
0125 #   endif
0126 #endif
0127 
0128 #if defined(__has_cpp_attribute)
0129 #   if __has_cpp_attribute(maybe_unused)
0130 #       define BOOST_PFR_MAYBE_UNUSED [[maybe_unused]]
0131 #   endif
0132 #endif
0133 
0134 #ifndef BOOST_PFR_MAYBE_UNUSED
0135 #   define BOOST_PFR_MAYBE_UNUSED
0136 #endif
0137 
0138 #ifndef BOOST_PFR_ENABLED
0139 #   ifdef BOOST_PFR_NOT_SUPPORTED
0140 #       define BOOST_PFR_ENABLED 0
0141 #   else
0142 #       define BOOST_PFR_ENABLED 1
0143 #   endif
0144 #endif
0145 
0146 #undef BOOST_PFR_NOT_SUPPORTED
0147 
0148 #endif // BOOST_PFR_CONFIG_HPP