Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-16 09:17:29

0001 // (C) Copyright David Abrahams 2002.
0002 // (C) Copyright Jeremy Siek    2002.
0003 // (C) Copyright Thomas Witt    2002.
0004 // Distributed under the Boost Software License, Version 1.0. (See
0005 // accompanying file LICENSE_1_0.txt or copy at
0006 // http://www.boost.org/LICENSE_1_0.txt)
0007 
0008 // no include guard multiple inclusion intended
0009 
0010 //
0011 // This is a temporary workaround until the bulk of this is
0012 // available in boost config.
0013 // 23/02/03 thw
0014 //
0015 
0016 #include <boost/config.hpp> // for prior
0017 #include <boost/detail/workaround.hpp>
0018 
0019 #ifdef BOOST_ITERATOR_CONFIG_DEF
0020 # error you have nested config_def #inclusion.
0021 #else
0022 # define BOOST_ITERATOR_CONFIG_DEF
0023 #endif
0024 
0025 // We enable this always now.  Otherwise, the simple case in
0026 // libs/iterator/test/constant_iterator_arrow.cpp fails to compile
0027 // because the operator-> return is improperly deduced as a non-const
0028 // pointer.
0029 #if 1 || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)           \
0030     || BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x531))
0031 
0032 // Recall that in general, compilers without partial specialization
0033 // can't strip constness.  Consider counting_iterator, which normally
0034 // passes a const Value to iterator_facade.  As a result, any code
0035 // which makes a std::vector of the iterator's value_type will fail
0036 // when its allocator declares functions overloaded on reference and
0037 // const_reference (the same type).
0038 //
0039 // Furthermore, Borland 5.5.1 drops constness in enough ways that we
0040 // end up using a proxy for operator[] when we otherwise shouldn't.
0041 // Using reference constness gives it an extra hint that it can
0042 // return the value_type from operator[] directly, but is not
0043 // strictly necessary.  Not sure how best to resolve this one.
0044 
0045 # define BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY 1
0046 
0047 #endif
0048 
0049 #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x5A0))                      \
0050     || (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER)) \
0051     || BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))                \
0052     || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
0053 
0054 # define BOOST_NO_LVALUE_RETURN_DETECTION
0055 
0056 # if 0 // test code
0057   struct v  {};
0058 
0059   typedef  char (&no)[3];
0060 
0061   template <class T>
0062   no foo(T const&, ...);
0063 
0064   template <class T>
0065   char foo(T&, int);
0066 
0067 
0068   struct value_iterator
0069   {
0070       v operator*() const;
0071   };
0072 
0073   template <class T>
0074   struct lvalue_deref_helper
0075   {
0076       static T& x;
0077       enum { value = (sizeof(foo(*x,0)) == 1) };
0078   };
0079 
0080   int z2[(lvalue_deref_helper<v*>::value == 1) ? 1 : -1];
0081   int z[(lvalue_deref_helper<value_iterator>::value) == 1 ? -1 : 1 ];
0082 # endif
0083 
0084 #endif
0085 
0086 #if BOOST_WORKAROUND(__MWERKS__, <=0x2407)
0087 #  define BOOST_NO_IS_CONVERTIBLE // "is_convertible doesn't work for simple types"
0088 #endif
0089 
0090 #if BOOST_WORKAROUND(__GNUC__, == 3) && BOOST_WORKAROUND(__GNUC_MINOR__, < 4) && !defined(__EDG_VERSION__)   \
0091     || BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551))
0092 #  define BOOST_NO_IS_CONVERTIBLE_TEMPLATE // The following program fails to compile:
0093 
0094 #  if 0 // test code
0095     #include <boost/type_traits/is_convertible.hpp>
0096     template <class T>
0097     struct foo
0098     {
0099         foo(T);
0100 
0101         template <class U>
0102         foo(foo<U> const& other) : p(other.p) { }
0103 
0104         T p;
0105     };
0106 
0107     bool x = boost::is_convertible<foo<int const*>, foo<int*> >::value;
0108 #  endif
0109 
0110 #endif
0111 
0112 
0113 #if !defined(BOOST_MSVC) && (defined(BOOST_NO_SFINAE) || defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_IS_CONVERTIBLE_TEMPLATE))
0114 # define BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
0115 #endif
0116 
0117 # if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
0118 
0119 // GCC-2.95 (obsolete) eagerly instantiates templated constructors and conversion
0120 // operators in convertibility checks, causing premature errors.
0121 //
0122 // Borland's problems are harder to diagnose due to lack of an
0123 // instantiation stack backtrace.  They may be due in part to the fact
0124 // that it drops cv-qualification willy-nilly in templates.
0125 #  define BOOST_NO_ONE_WAY_ITERATOR_INTEROP
0126 # endif
0127 
0128 // no include guard; multiple inclusion intended