forked from boostorg/iterator
fixes and cleanups
[SVN r1141]
This commit is contained in:
@@ -8,21 +8,22 @@
|
||||
#define BOOST_ITERATOR_DETAIL_CATEGORIES_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/iterator/detail/config_def.hpp>
|
||||
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#include <boost/type_traits/is_base_and_derived.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/apply_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/or.hpp>
|
||||
#include <boost/mpl/and.hpp>
|
||||
#include <iterator>
|
||||
|
||||
#if BOOST_WORKAROUND(__MWERKS__, <=0x2407)
|
||||
# define BOOST_NO_IS_CONVERTIBLE // "Convertible does not provide enough/is not working"
|
||||
#endif
|
||||
#include <iterator>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@@ -296,8 +297,6 @@ namespace boost
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#ifdef BOOST_NO_IS_CONVERTIBLE
|
||||
# undef BOOST_NO_IS_CONVERTIBLE
|
||||
#endif
|
||||
#include <boost/iterator/detail/config_undef.hpp>
|
||||
|
||||
#endif // BOOST_ITERATOR_DETAIL_CATEGORIES_HPP
|
||||
|
||||
@@ -18,26 +18,81 @@
|
||||
#include <boost/config.hpp> // for prior
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#define BOOST_ITERATOR_CONFIG_DEF // if you get an error here, you have nested config_def #inclusion.
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
|
||||
|| BOOST_WORKAROUND(__GNUC__, <= 2 && __GNUC_MINOR__ <= 95) \
|
||||
|| BOOST_WORKAROUND(__MWERKS__, <= 0x3000)
|
||||
|| BOOST_WORKAROUND(__MWERKS__, <= 0x3000) \
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
|
||||
# define BOOST_NO_SFINAE // "Substitution Failure Is Not An Error not implemented"
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <=1200)
|
||||
# define BOOST_ARG_DEP_TYPENAME
|
||||
#else
|
||||
# define BOOST_ARG_DEP_TYPENAME typename
|
||||
# if 0 // test code
|
||||
template <bool x>
|
||||
struct bar
|
||||
{
|
||||
typedef int type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct bar<false>
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
template <class T>
|
||||
struct foo : bar<(sizeof(T) == 1)>
|
||||
{
|
||||
};
|
||||
|
||||
template <class T>
|
||||
char* f(int, typename foo<T>::type = 0) { return 0; }
|
||||
|
||||
template <class T>
|
||||
int f(...) { return 0; }
|
||||
|
||||
char* x = f<char>(0);
|
||||
int y = f<char[2]>(0);
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(__MWERKS__, <=0x2407)
|
||||
# define BOOST_NO_IS_CONVERTIBLE // "is_convertible doesn't always work"
|
||||
# define BOOST_NO_IS_CONVERTIBLE // "is_convertible doesn't work for simple types"
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(3)) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
|
||||
# define BOOST_NO_IS_CONVERTIBLE_TEMPLATE // The following program fails to compile:
|
||||
|
||||
# if 0 // test code
|
||||
template <class T>
|
||||
struct foo
|
||||
{
|
||||
foo(T);
|
||||
|
||||
template <class U>
|
||||
foo(foo<U> const& other) : p(other.p) { }
|
||||
|
||||
T p;
|
||||
};
|
||||
|
||||
bool x = boost::is_convertible<foo<int const*>, foo<int*> >::value;
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(__GNUC__, == 2 && __GNUC_MINOR__ == 95) \
|
||||
|| BOOST_WORKAROUND(__MWERKS__, <= 0x2407) \
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
|
||||
# define BOOST_NO_MPL_AUX_HAS_XXX // "MPL's has_xxx facility doesn't work"
|
||||
# define BOOST_ITERATOR_NO_MPL_AUX_HAS_XXX // "MPL's has_xxx facility doesn't work"
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_SFINAE) || defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_IS_CONVERTIBLE_TEMPLATE)
|
||||
# define BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
|
||||
#endif
|
||||
|
||||
// no include guard multiple inclusion intended
|
||||
|
||||
@@ -13,8 +13,13 @@
|
||||
// 23/02/03 thw
|
||||
//
|
||||
|
||||
# undef BOOST_NO_SFINAE
|
||||
# undef BOOST_ARG_DEP_TYPENAME
|
||||
# undef BOOST_NO_IS_CONVERTIBLE
|
||||
# undef BOOST_NO_MPL_AUX_HAS_XXX
|
||||
#undef BOOST_NO_SFINAE
|
||||
#undef BOOST_NO_IS_CONVERTIBLE
|
||||
#undef BOOST_NO_IS_CONVERTIBLE_TEMPLATE
|
||||
#undef BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
|
||||
|
||||
#ifdef BOOST_ITERATOR_CONFIG_DEF
|
||||
# undef BOOST_ITERATOR_CONFIG_DEF
|
||||
#else
|
||||
# error missing or nested #include config_def
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user