1 // (C) Copyright David Abrahams 2002.
\r
2 // (C) Copyright Jeremy Siek 2002.
\r
3 // (C) Copyright Thomas Witt 2002.
\r
4 // Distributed under the Boost Software License, Version 1.0. (See
\r
5 // accompanying file LICENSE_1_0.txt or copy at
\r
6 // http://www.boost.org/LICENSE_1_0.txt)
\r
8 // no include guard multiple inclusion intended
\r
11 // This is a temporary workaround until the bulk of this is
\r
12 // available in boost config.
\r
16 #include <boost/config.hpp> // for prior
\r
17 #include <boost/detail/workaround.hpp>
\r
19 #ifdef BOOST_ITERATOR_CONFIG_DEF
\r
20 # error you have nested config_def #inclusion.
\r
22 # define BOOST_ITERATOR_CONFIG_DEF
\r
25 // We enable this always now. Otherwise, the simple case in
\r
26 // libs/iterator/test/constant_iterator_arrow.cpp fails to compile
\r
27 // because the operator-> return is improperly deduced as a non-const
\r
29 #if 1 || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
\r
30 || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x531))
\r
32 // Recall that in general, compilers without partial specialization
\r
33 // can't strip constness. Consider counting_iterator, which normally
\r
34 // passes a const Value to iterator_facade. As a result, any code
\r
35 // which makes a std::vector of the iterator's value_type will fail
\r
36 // when its allocator declares functions overloaded on reference and
\r
37 // const_reference (the same type).
\r
39 // Furthermore, Borland 5.5.1 drops constness in enough ways that we
\r
40 // end up using a proxy for operator[] when we otherwise shouldn't.
\r
41 // Using reference constness gives it an extra hint that it can
\r
42 // return the value_type from operator[] directly, but is not
\r
43 // strictly necessary. Not sure how best to resolve this one.
\r
45 # define BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY 1
\r
49 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
\r
50 || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x5A0)) \
\r
51 || (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER)) \
\r
52 || BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) \
\r
53 || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
\r
55 # define BOOST_NO_LVALUE_RETURN_DETECTION
\r
60 typedef char (&no)[3];
\r
63 no foo(T const&, ...);
\r
69 struct value_iterator
\r
71 v operator*() const;
\r
75 struct lvalue_deref_helper
\r
78 enum { value = (sizeof(foo(*x,0)) == 1) };
\r
81 int z2[(lvalue_deref_helper<v*>::value == 1) ? 1 : -1];
\r
82 int z[(lvalue_deref_helper<value_iterator>::value) == 1 ? -1 : 1 ];
\r
87 #if BOOST_WORKAROUND(__MWERKS__, <=0x2407)
\r
88 # define BOOST_NO_IS_CONVERTIBLE // "is_convertible doesn't work for simple types"
\r
91 #if BOOST_WORKAROUND(__GNUC__, == 2) \
\r
92 || BOOST_WORKAROUND(__GNUC__, == 3) && BOOST_WORKAROUND(__GNUC_MINOR__, < 4) && !defined(__EDG_VERSION__) \
\r
93 || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
\r
94 # define BOOST_NO_IS_CONVERTIBLE_TEMPLATE // The following program fails to compile:
\r
97 #include <boost/type_traits/is_convertible.hpp>
\r
104 foo(foo<U> const& other) : p(other.p) { }
\r
109 bool x = boost::is_convertible<foo<int const*>, foo<int*> >::value;
\r
115 #if !defined(BOOST_MSVC) && (defined(BOOST_NO_SFINAE) || defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_IS_CONVERTIBLE_TEMPLATE))
\r
116 # define BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
\r
119 # if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
\r
120 # define BOOST_ARG_DEPENDENT_TYPENAME typename
\r
122 # define BOOST_ARG_DEPENDENT_TYPENAME
\r
125 # if BOOST_WORKAROUND(__GNUC__, == 2) && BOOST_WORKAROUND(__GNUC_MINOR__, BOOST_TESTED_AT(95)) \
\r
126 || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
\r
128 // GCC-2.95 eagerly instantiates templated constructors and conversion
\r
129 // operators in convertibility checks, causing premature errors.
\r
131 // Borland's problems are harder to diagnose due to lack of an
\r
132 // instantiation stack backtrace. They may be due in part to the fact
\r
133 // that it drops cv-qualification willy-nilly in templates.
\r
134 # define BOOST_NO_ONE_WAY_ITERATOR_INTEROP
\r
137 // no include guard; multiple inclusion intended
\r