forked from boostorg/iterator
borland workarounds
[SVN r848]
This commit is contained in:
@@ -21,6 +21,10 @@
|
|||||||
|| BOOST_WORKAROUND(__GNUC__, <= 2 && __GNUC_MINOR__ <= 95) \
|
|| BOOST_WORKAROUND(__GNUC__, <= 2 && __GNUC_MINOR__ <= 95) \
|
||||||
|| BOOST_WORKAROUND(__MWERKS__, <= 0x3000)
|
|| BOOST_WORKAROUND(__MWERKS__, <= 0x3000)
|
||||||
# define BOOST_NO_SFINAE // "Substitution Failure Is Not An Error not implemented"
|
# define BOOST_NO_SFINAE // "Substitution Failure Is Not An Error not implemented"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
|
||||||
|
# define BOOST_NO_ENABLE_IF_CONSTRUCTORS // Can't parse the syntax needed for enable_if in constructors
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BOOST_WORKAROUND(BOOST_MSVC, <=1200)
|
#if BOOST_WORKAROUND(BOOST_MSVC, <=1200)
|
||||||
@@ -35,8 +39,9 @@
|
|||||||
# define BOOST_NO_IS_CONVERTIBLE // "is_convertible doesn't work"
|
# define BOOST_NO_IS_CONVERTIBLE // "is_convertible doesn't work"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BOOST_WORKAROUND(__GNUC__, == 2 && __GNUC_MINOR__ == 95) \
|
#if BOOST_WORKAROUND(__GNUC__, == 2 && __GNUC_MINOR__ == 95) \
|
||||||
|| BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
|
|| 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_NO_MPL_AUX_HAS_XXX // "MPL's has_xxx facility doesn't work"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -126,7 +131,9 @@ namespace boost {
|
|||||||
class Return>
|
class Return>
|
||||||
struct enable_if_interoperable
|
struct enable_if_interoperable
|
||||||
# if !defined(BOOST_NO_SFINAE) && !defined(BOOST_NO_IS_CONVERTIBLE)
|
# if !defined(BOOST_NO_SFINAE) && !defined(BOOST_NO_IS_CONVERTIBLE)
|
||||||
: enabled< is_interoperable<Facade1, Facade2>::value >::template base<Return>
|
: detail::enabled<
|
||||||
|
::boost::detail::is_interoperable<Facade1, Facade2>::value
|
||||||
|
>::template base<Return>
|
||||||
# else
|
# else
|
||||||
: mpl::identity<Return>
|
: mpl::identity<Return>
|
||||||
# endif
|
# endif
|
||||||
@@ -188,7 +195,9 @@ namespace boost {
|
|||||||
typename To>
|
typename To>
|
||||||
struct enable_if_convertible
|
struct enable_if_convertible
|
||||||
#if !defined(BOOST_NO_IS_CONVERTIBLE) && !defined(BOOST_NO_SFINAE)
|
#if !defined(BOOST_NO_IS_CONVERTIBLE) && !defined(BOOST_NO_SFINAE)
|
||||||
: detail::enabled< is_convertible<From, To>::value >::template base<detail::enable_type>
|
: detail::enabled<
|
||||||
|
::boost::is_convertible<From, To>::value
|
||||||
|
>::template base<detail::enable_type>
|
||||||
#else
|
#else
|
||||||
: mpl::identity<detail::enable_type>
|
: mpl::identity<detail::enable_type>
|
||||||
#endif
|
#endif
|
||||||
@@ -657,8 +666,12 @@ namespace boost {
|
|||||||
: super_t(x) {}
|
: super_t(x) {}
|
||||||
|
|
||||||
template<class OtherIterator>
|
template<class OtherIterator>
|
||||||
reverse_iterator(reverse_iterator<OtherIterator> const& r,
|
reverse_iterator(
|
||||||
typename enable_if_convertible<OtherIterator, Iterator>::type* = 0)
|
reverse_iterator<OtherIterator> const& r
|
||||||
|
# ifndef BOOST_NO_ENABLE_IF_CONSTRUCTORS
|
||||||
|
, typename enable_if_convertible<OtherIterator, Iterator>::type* = 0
|
||||||
|
# endif
|
||||||
|
)
|
||||||
: super_t(r.base()) {}
|
: super_t(r.base()) {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -708,8 +721,12 @@ namespace boost {
|
|||||||
: super_t(x), m_f(f) { }
|
: super_t(x), m_f(f) { }
|
||||||
|
|
||||||
template<class OtherIterator>
|
template<class OtherIterator>
|
||||||
transform_iterator(transform_iterator<AdaptableUnaryFunction, OtherIterator> const& t,
|
transform_iterator(
|
||||||
typename enable_if_convertible<OtherIterator, Iterator>::type* = 0)
|
transform_iterator<AdaptableUnaryFunction, OtherIterator> const& t
|
||||||
|
# ifndef BOOST_NO_ENABLE_IF_CONSTRUCTORS
|
||||||
|
, typename enable_if_convertible<OtherIterator, Iterator>::type* = 0
|
||||||
|
# endif
|
||||||
|
)
|
||||||
: super_t(t.base()), m_f(t.functor()) {}
|
: super_t(t.base()), m_f(t.functor()) {}
|
||||||
|
|
||||||
AdaptableUnaryFunction functor() const { return m_f; }
|
AdaptableUnaryFunction functor() const { return m_f; }
|
||||||
@@ -826,8 +843,13 @@ namespace boost {
|
|||||||
|
|
||||||
template <class OtherIterator,
|
template <class OtherIterator,
|
||||||
class OtherTraits>
|
class OtherTraits>
|
||||||
indirect_iterator(indirect_iterator<OtherIterator, OtherTraits> const& y,
|
indirect_iterator(
|
||||||
typename enable_if_convertible<OtherIterator, Iterator>::type* = 0)
|
indirect_iterator<OtherIterator, OtherTraits> const& y
|
||||||
|
# ifndef BOOST_NO_ENABLE_IF_CONSTRUCTORS
|
||||||
|
, typename enable_if_convertible<OtherIterator, Iterator>::type* = 0
|
||||||
|
# endif
|
||||||
|
)
|
||||||
|
|
||||||
: super_t(y.base()) {}
|
: super_t(y.base()) {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -45,8 +45,8 @@ void readable_iterator_test(const Iterator i1, T v)
|
|||||||
T v2 = r2;
|
T v2 = r2;
|
||||||
assert(v1 == v);
|
assert(v1 == v);
|
||||||
assert(v2 == v);
|
assert(v2 == v);
|
||||||
typedef typename return_category<Iterator>::type result_category;
|
typename return_category<Iterator>::type result_category;
|
||||||
is_readable(result_category());
|
is_readable(result_category);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Iterator, class T>
|
template <class Iterator, class T>
|
||||||
|
@@ -28,9 +28,9 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#if defined(BOOST_MSVC_STD_ITERATOR) \
|
#if defined(BOOST_MSVC_STD_ITERATOR) \
|
||||||
|| BOOST_WORKAROUND(_CPPLIB_VER, <= 310) \
|
|| BOOST_WORKAROUND(_CPPLIB_VER, <= 310) \
|
||||||
|| BOOST_WORKAROUND(__GNUC__, <= 2 && !defined(__SGI_STL_PORT))
|
|| BOOST_WORKAROUND(__GNUC__, <= 2 && !__SGI_STL_PORT)
|
||||||
|
|
||||||
// std container random-access iterators don't support mutable/const
|
// std container random-access iterators don't support mutable/const
|
||||||
// interoperability (but may support const/mutable interop).
|
// interoperability (but may support const/mutable interop).
|
||||||
@@ -108,7 +108,6 @@ namespace boost { namespace detail
|
|||||||
|
|
||||||
void more_indirect_iterator_tests()
|
void more_indirect_iterator_tests()
|
||||||
{
|
{
|
||||||
// For some reason all heck breaks loose in the compiler under these conditions.
|
|
||||||
storage store(1000);
|
storage store(1000);
|
||||||
std::generate(store.begin(), store.end(), rand);
|
std::generate(store.begin(), store.end(), rand);
|
||||||
|
|
||||||
@@ -154,7 +153,10 @@ void more_indirect_iterator_tests()
|
|||||||
|
|
||||||
// Borland C++ is getting very confused about the typedefs here
|
// Borland C++ is getting very confused about the typedefs here
|
||||||
typedef boost::indirect_iterator<iterator_set::iterator> indirect_set_iterator;
|
typedef boost::indirect_iterator<iterator_set::iterator> indirect_set_iterator;
|
||||||
typedef boost::indirect_iterator<iterator_set::const_iterator> const_indirect_set_iterator;
|
typedef boost::indirect_iterator<
|
||||||
|
iterator_set::iterator
|
||||||
|
, indirect_const_iterator_traits<iterator_set::iterator>
|
||||||
|
> const_indirect_set_iterator;
|
||||||
|
|
||||||
indirect_set_iterator sb(iter_set.begin());
|
indirect_set_iterator sb(iter_set.begin());
|
||||||
indirect_set_iterator se(iter_set.end());
|
indirect_set_iterator se(iter_set.end());
|
||||||
@@ -189,8 +191,19 @@ main()
|
|||||||
|
|
||||||
// Concept checks
|
// Concept checks
|
||||||
{
|
{
|
||||||
typedef boost::indirect_iterator<shared_t::iterator> iter_t;
|
typedef boost::indirect_iterator<shared_t::iterator> iter_t;
|
||||||
typedef boost::indirect_iterator<shared_t::const_iterator> c_iter_t;
|
|
||||||
|
BOOST_STATIC_ASSERT(
|
||||||
|
boost::detail::has_element_type<
|
||||||
|
boost::shared_ptr<dummyT>
|
||||||
|
// std::iterator_traits<shared_t::iterator>::value_type
|
||||||
|
>::value
|
||||||
|
);
|
||||||
|
|
||||||
|
typedef boost::indirect_iterator<
|
||||||
|
shared_t::iterator
|
||||||
|
, indirect_const_iterator_traits<shared_t::iterator>
|
||||||
|
> c_iter_t;
|
||||||
|
|
||||||
# ifndef NO_MUTABLE_CONST_RA_ITERATOR_INTEROPERABILITY
|
# ifndef NO_MUTABLE_CONST_RA_ITERATOR_INTEROPERABILITY
|
||||||
boost::function_requires< boost_concepts::InteroperableConcept<iter_t, c_iter_t> >();
|
boost::function_requires< boost_concepts::InteroperableConcept<iter_t, c_iter_t> >();
|
||||||
|
Reference in New Issue
Block a user