Borland workarounds

[SVN r20879]
This commit is contained in:
Dave Abrahams
2003-11-20 16:17:30 +00:00
parent f46f7f8091
commit 6b2da49430
2 changed files with 56 additions and 4 deletions
+28 -2
View File
@@ -5,13 +5,26 @@
# define IS_LVALUE_ITERATOR_DWA2003112_HPP
#include <boost/mpl/bool.hpp>
#include <boost/detail/workaround.hpp>
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
# include <boost/mpl/if.hpp>
# include <boost/mpl/and.hpp>
# include <boost/mpl/not.hpp>
#endif
#include <boost/detail/iterator.hpp>
#include <boost/iterator.hpp>
#include <boost/type_traits/detail/bool_trait_def.hpp>
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
# include <boost/type_traits/is_integral.hpp>
# include <boost/type_traits/is_const.hpp>
#endif
#include <boost/iterator/detail/any_conversion_eater.hpp>
// should be the last #include
// should be the last #includes
#include <boost/type_traits/detail/bool_trait_def.hpp>
#include <boost/iterator/detail/config_def.hpp>
#ifndef BOOST_NO_IS_CONVERTIBLE
@@ -49,7 +62,19 @@ namespace detail
// convertible to Value const&
struct conversion_eater
{
// Borland (at leasT 5.5.1) has some problems converting to
// non-const Value& where Value is an integral type.
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
typedef typename mpl::if_<
mpl::and_<is_integral<Value>, mpl::not_<is_const<Value> > >
, Value
, Value&
>::type src;
conversion_eater(src);
#else
conversion_eater(Value&);
#endif
};
static char tester(conversion_eater, int);
@@ -144,5 +169,6 @@ BOOST_TT_AUX_BOOL_TRAIT_DEF1(
#endif
#include <boost/iterator/detail/config_undef.hpp>
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // IS_LVALUE_ITERATOR_DWA2003112_HPP