Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal.
0002 // Copyright (C) 2015 - 2017 Andrzej Krzemienski.
0003 //
0004 // Use, modification, and distribution is subject to the Boost Software
0005 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0006 // http://www.boost.org/LICENSE_1_0.txt)
0007 //
0008 // See http://www.boost.org/libs/optional for documentation.
0009 //
0010 // You are welcome to contact the author at:
0011 //  akrzemi1@gmail.com
0012 
0013 #ifndef BOOST_OPTIONAL_DETAIL_OPTIONAL_CONFIG_AJK_28JAN2015_HPP
0014 #define BOOST_OPTIONAL_DETAIL_OPTIONAL_CONFIG_AJK_28JAN2015_HPP
0015 
0016 #include <boost/config.hpp>
0017 #include <boost/detail/workaround.hpp>
0018 
0019 #if (defined BOOST_NO_CXX11_RVALUE_REFERENCES) || (defined BOOST_OPTIONAL_CONFIG_NO_RVALUE_REFERENCES)
0020 # define BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
0021 #endif
0022 
0023 #if BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION,<=700)
0024 // AFAICT only Intel 7 correctly resolves the overload set
0025 // that includes the in-place factory taking functions,
0026 // so for the other icc versions, in-place factory support
0027 // is disabled
0028 # define BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
0029 #endif
0030 
0031 #if BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x551)
0032 // BCB (5.5.1) cannot parse the nested template struct in an inplace factory.
0033 # define BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
0034 #endif
0035 
0036 #if !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) \
0037     && defined BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
0038 // BCB (up to 5.64) has the following bug:
0039 //   If there is a member function/operator template of the form
0040 //     template<class Expr> mfunc( Expr expr ) ;
0041 //   some calls are resolved to this even if there are other better matches.
0042 //   The effect of this bug is that calls to converting ctors and assignments
0043 //   are incorrectly sink to this general catch-all member function template as shown above.
0044 # define BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION
0045 #endif
0046 
0047 #if !defined(BOOST_NO_MAY_ALIAS)
0048 // GCC since 3.3 and some other compilers have may_alias attribute that helps to alleviate
0049 // optimizer issues with regard to violation of the strict aliasing rules. The optional< T >
0050 // storage type is marked with this attribute in order to let the compiler know that it will
0051 // alias objects of type T and silence compilation warnings.
0052 # define BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS
0053 #endif
0054 
0055 #if (defined(_MSC_VER) && _MSC_VER <= 1800)
0056 // on MSVC 2013 and earlier an unwanted temporary is created when you assign from
0057 // a const lvalue of integral type. Thus we bind not to the original address but
0058 // to a temporary. 
0059 # define BOOST_OPTIONAL_CONFIG_NO_PROPER_ASSIGN_FROM_CONST_INT
0060 #endif
0061 
0062 #if (defined __GNUC__) && (!defined BOOST_INTEL_CXX_VERSION) && (!defined __clang__)
0063 // On some GCC versions an unwanted temporary is created when you copy-initialize
0064 // from a const lvalue of integral type. Thus we bind not to the original address but
0065 // to a temporary.
0066 
0067 # if (__GNUC__ < 4)
0068 #  define BOOST_OPTIONAL_CONFIG_NO_PROPER_CONVERT_FROM_CONST_INT
0069 # endif
0070 
0071 # if (__GNUC__ == 4 && __GNUC_MINOR__ <= 5)
0072 #  define BOOST_OPTIONAL_CONFIG_NO_PROPER_CONVERT_FROM_CONST_INT
0073 # endif
0074 
0075 # if (__GNUC__ == 5 && __GNUC_MINOR__ < 2)
0076 #  define BOOST_OPTIONAL_CONFIG_NO_PROPER_CONVERT_FROM_CONST_INT
0077 # endif
0078 
0079 # if (__GNUC__ == 5 && __GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ == 0)
0080 #  define BOOST_OPTIONAL_CONFIG_NO_PROPER_CONVERT_FROM_CONST_INT
0081 # endif
0082 
0083 #endif // defined(__GNUC__)
0084 
0085 #if (defined __GNUC__) && (!defined BOOST_NO_CXX11_RVALUE_REFERENCES)
0086 // On some initial rvalue reference implementations GCC does it in a strange way,
0087 // preferring perfect-forwarding constructor to implicit copy constructor.
0088 
0089 # if (__GNUC__ == 4 && __GNUC_MINOR__ == 4)
0090 #  define BOOST_OPTIONAL_CONFIG_NO_LEGAL_CONVERT_FROM_REF
0091 # endif
0092 
0093 # if (__GNUC__ == 4 && __GNUC_MINOR__ == 5)
0094 #  define BOOST_OPTIONAL_CONFIG_NO_LEGAL_CONVERT_FROM_REF
0095 # endif
0096 
0097 #endif // defined(__GNUC__)
0098 
0099 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500) && !defined(__SUNPRO_CC)
0100   // this condition is a copy paste from is_constructible.hpp
0101   // I also disable SUNPRO, as it seems not to support type_traits correctly
0102 #else
0103 # define BOOST_OPTIONAL_DETAIL_NO_IS_CONSTRUCTIBLE_TRAIT
0104 #endif
0105 
0106 #if defined __SUNPRO_CC
0107 # define BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS
0108 #elif (defined _MSC_FULL_VER) && (_MSC_FULL_VER < 190023026)
0109 # define BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS
0110 #elif defined BOOST_GCC && !defined BOOST_GCC_CXX11
0111 # define BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS
0112 #elif defined BOOST_GCC_VERSION && BOOST_GCC_VERSION < 40800
0113 # define BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS
0114 #endif
0115 
0116 
0117 // Detect support for defaulting move operations
0118 // (some older compilers implement rvalue references,
0119 // defaulted functions but move operations are not special members and cannot be defaulted)
0120 
0121 #ifdef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
0122 # define BOOST_OPTIONAL_DETAIL_NO_DEFAULTED_MOVE_FUNCTIONS
0123 #elif BOOST_WORKAROUND(BOOST_MSVC, < 1900)
0124 # define BOOST_OPTIONAL_DETAIL_NO_DEFAULTED_MOVE_FUNCTIONS
0125 #elif BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40600)
0126 # define BOOST_OPTIONAL_DETAIL_NO_DEFAULTED_MOVE_FUNCTIONS
0127 #endif
0128 
0129 
0130 #ifdef BOOST_OPTIONAL_CONFIG_NO_DIRECT_STORAGE_SPEC
0131 # define BOOST_OPTIONAL_DETAIL_NO_DIRECT_STORAGE_SPEC
0132 #endif
0133 
0134 
0135 #endif // header guard