forked from boostorg/iterator
updates for MPL renaming; restore some portability.
[SVN r1059]
This commit is contained in:
@@ -13,8 +13,8 @@
|
|||||||
#include <boost/type_traits/is_convertible.hpp>
|
#include <boost/type_traits/is_convertible.hpp>
|
||||||
#include <boost/type_traits/is_same.hpp>
|
#include <boost/type_traits/is_same.hpp>
|
||||||
#include <boost/mpl/if.hpp>
|
#include <boost/mpl/if.hpp>
|
||||||
#include <boost/mpl/bool_c.hpp>
|
#include <boost/mpl/bool.hpp>
|
||||||
#include <boost/mpl/logical/or.hpp>
|
#include <boost/mpl/or.hpp>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
||||||
#if BOOST_WORKAROUND(__MWERKS__, <=0x2407)
|
#if BOOST_WORKAROUND(__MWERKS__, <=0x2407)
|
||||||
@@ -431,7 +431,7 @@ namespace boost {
|
|||||||
|
|
||||||
template <class Base, class Derived>
|
template <class Base, class Derived>
|
||||||
struct is_base_or_same :
|
struct is_base_or_same :
|
||||||
mpl::logical_or< is_same< Base, Derived >,
|
mpl::or_< is_same< Base, Derived >,
|
||||||
is_base_and_derived< Base, Derived > >
|
is_base_and_derived< Base, Derived > >
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
@@ -17,6 +17,7 @@
|
|||||||
#ifdef BOOST_NO_MPL_AUX_HAS_XXX
|
#ifdef BOOST_NO_MPL_AUX_HAS_XXX
|
||||||
# include <boost/shared_ptr.hpp>
|
# include <boost/shared_ptr.hpp>
|
||||||
# include <boost/scoped_ptr.hpp>
|
# include <boost/scoped_ptr.hpp>
|
||||||
|
# include <boost/mpl/bool.hpp>
|
||||||
# include <memory>
|
# include <memory>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -43,12 +44,12 @@ namespace boost
|
|||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
struct has_element_type
|
struct has_element_type
|
||||||
: mpl::if_<
|
{
|
||||||
|
typedef typename mpl::if_<
|
||||||
is_class<T>
|
is_class<T>
|
||||||
, aux::has_element_type<T>
|
, aux::has_element_type<T>
|
||||||
, mpl::false_c
|
, mpl::false_
|
||||||
>::type
|
>::type type;
|
||||||
{
|
|
||||||
};
|
};
|
||||||
# else
|
# else
|
||||||
template <class T>
|
template <class T>
|
||||||
|
@@ -9,8 +9,8 @@
|
|||||||
#ifndef BOOST_INTEROPERABLE_23022003THW_HPP
|
#ifndef BOOST_INTEROPERABLE_23022003THW_HPP
|
||||||
#define BOOST_INTEROPERABLE_23022003THW_HPP
|
#define BOOST_INTEROPERABLE_23022003THW_HPP
|
||||||
|
|
||||||
#include <boost/mpl/bool_c.hpp>
|
#include <boost/mpl/bool.hpp>
|
||||||
#include <boost/mpl/logical/or.hpp>
|
#include <boost/mpl/or.hpp>
|
||||||
|
|
||||||
#include <boost/type_traits/is_convertible.hpp>
|
#include <boost/type_traits/is_convertible.hpp>
|
||||||
|
|
||||||
@@ -36,9 +36,9 @@ namespace boost
|
|||||||
template <typename A, typename B>
|
template <typename A, typename B>
|
||||||
struct is_interoperable
|
struct is_interoperable
|
||||||
#if defined(BOOST_NO_IS_CONVERTIBLE)
|
#if defined(BOOST_NO_IS_CONVERTIBLE)
|
||||||
: mpl::true_c
|
: mpl::true_
|
||||||
#else
|
#else
|
||||||
: mpl::logical_or<
|
: mpl::or_<
|
||||||
is_convertible< A, B >
|
is_convertible< A, B >
|
||||||
, is_convertible< B, A > >
|
, is_convertible< B, A > >
|
||||||
#endif
|
#endif
|
||||||
|
@@ -16,8 +16,8 @@
|
|||||||
#include <boost/iterator/iterator_facade.hpp>
|
#include <boost/iterator/iterator_facade.hpp>
|
||||||
#include <boost/iterator/detail/enable_if.hpp>
|
#include <boost/iterator/detail/enable_if.hpp>
|
||||||
|
|
||||||
#include <boost/mpl/logical/and.hpp>
|
#include <boost/mpl/and.hpp>
|
||||||
#include <boost/mpl/logical/or.hpp>
|
#include <boost/mpl/or.hpp>
|
||||||
|
|
||||||
#include <boost/type_traits/is_same.hpp>
|
#include <boost/type_traits/is_same.hpp>
|
||||||
#include <boost/type_traits/is_convertible.hpp>
|
#include <boost/type_traits/is_convertible.hpp>
|
||||||
@@ -31,7 +31,7 @@ namespace boost
|
|||||||
{
|
{
|
||||||
template <class Traits, class Other>
|
template <class Traits, class Other>
|
||||||
struct same_category_and_difference
|
struct same_category_and_difference
|
||||||
: mpl::logical_and<
|
: mpl::and_<
|
||||||
is_same<
|
is_same<
|
||||||
typename Traits::iterator_category
|
typename Traits::iterator_category
|
||||||
, typename Other::iterator_category
|
, typename Other::iterator_category
|
||||||
@@ -106,7 +106,7 @@ namespace boost
|
|||||||
# if BOOST_WORKAROUND(_MSC_FULL_VER, BOOST_TESTED_AT(13102292) && BOOST_MSVC > 1300)
|
# if BOOST_WORKAROUND(_MSC_FULL_VER, BOOST_TESTED_AT(13102292) && BOOST_MSVC > 1300)
|
||||||
// For some reason vc7.1 needs us to "cut off" instantiation
|
// For some reason vc7.1 needs us to "cut off" instantiation
|
||||||
// of is_convertible in the case where From == To.
|
// of is_convertible in the case where From == To.
|
||||||
mpl::logical_or<is_same<From,To>, is_convertible<From, To> >
|
mpl::or_<is_same<From,To>, is_convertible<From, To> >
|
||||||
# else
|
# else
|
||||||
::boost::is_convertible<From, To>
|
::boost::is_convertible<From, To>
|
||||||
# endif
|
# endif
|
||||||
|
@@ -18,11 +18,11 @@
|
|||||||
#include <boost/detail/workaround.hpp>
|
#include <boost/detail/workaround.hpp>
|
||||||
#include <boost/mpl/apply_if.hpp>
|
#include <boost/mpl/apply_if.hpp>
|
||||||
#include <boost/mpl/if.hpp>
|
#include <boost/mpl/if.hpp>
|
||||||
#include <boost/mpl/bool_c.hpp>
|
#include <boost/mpl/bool.hpp>
|
||||||
#include <boost/mpl/aux_/has_xxx.hpp>
|
#include <boost/mpl/aux_/has_xxx.hpp>
|
||||||
#include <boost/mpl/logical/not.hpp>
|
#include <boost/mpl/not.hpp>
|
||||||
#include <boost/mpl/logical/or.hpp>
|
#include <boost/mpl/or.hpp>
|
||||||
#include <boost/mpl/logical/and.hpp>
|
#include <boost/mpl/and.hpp>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
||||||
#if BOOST_WORKAROUND(__MWERKS__, <=0x2407)
|
#if BOOST_WORKAROUND(__MWERKS__, <=0x2407)
|
||||||
@@ -99,8 +99,8 @@ namespace boost {
|
|||||||
//
|
//
|
||||||
template <class Tag>
|
template <class Tag>
|
||||||
struct is_new_iterator_tag :
|
struct is_new_iterator_tag :
|
||||||
mpl::logical_and< mpl::logical_not< is_input_iterator<Tag> >,
|
mpl::and_< mpl::not_< is_input_iterator<Tag> >,
|
||||||
mpl::logical_not< is_output_iterator<Tag> > >
|
mpl::not_< is_output_iterator<Tag> > >
|
||||||
{};
|
{};
|
||||||
|
|
||||||
#elif BOOST_WORKAROUND(__GNUC__, == 2 && __GNUC_MINOR__ == 95) \
|
#elif BOOST_WORKAROUND(__GNUC__, == 2 && __GNUC_MINOR__ == 95) \
|
||||||
@@ -122,7 +122,8 @@ namespace boost {
|
|||||||
mpl::if_<
|
mpl::if_<
|
||||||
is_class<Tag>
|
is_class<Tag>
|
||||||
, has_traversal<Tag>
|
, has_traversal<Tag>
|
||||||
, mpl::bool_c<false> >::type
|
, mpl::false_
|
||||||
|
>::type
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -202,7 +203,7 @@ namespace boost {
|
|||||||
template <class RC, class TC>
|
template <class RC, class TC>
|
||||||
struct cvt_iterator_category
|
struct cvt_iterator_category
|
||||||
: mpl::if_<
|
: mpl::if_<
|
||||||
mpl::logical_or<
|
mpl::or_<
|
||||||
detail::is_mutable_lvalue_iterator<RC>
|
detail::is_mutable_lvalue_iterator<RC>
|
||||||
, detail::is_constant_lvalue_iterator<RC>
|
, detail::is_constant_lvalue_iterator<RC>
|
||||||
>
|
>
|
||||||
@@ -221,13 +222,13 @@ namespace boost {
|
|||||||
>::type
|
>::type
|
||||||
|
|
||||||
, typename mpl::if_<
|
, typename mpl::if_<
|
||||||
mpl::logical_and<
|
mpl::and_<
|
||||||
detail::is_readable_iterator<RC>
|
detail::is_readable_iterator<RC>
|
||||||
, detail::is_input_traversal_iterator<TC>
|
, detail::is_input_traversal_iterator<TC>
|
||||||
>
|
>
|
||||||
, std::input_iterator_tag
|
, std::input_iterator_tag
|
||||||
, typename mpl::if_<
|
, typename mpl::if_<
|
||||||
mpl::logical_and<
|
mpl::and_<
|
||||||
detail::is_writable_iterator<RC>
|
detail::is_writable_iterator<RC>
|
||||||
, detail::is_output_traversal_iterator<TC>
|
, detail::is_output_traversal_iterator<TC>
|
||||||
>
|
>
|
||||||
@@ -251,14 +252,14 @@ namespace boost {
|
|||||||
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||||
template <class T>
|
template <class T>
|
||||||
struct is_boost_iterator_tag
|
struct is_boost_iterator_tag
|
||||||
: mpl::false_c {};
|
: mpl::false_ {};
|
||||||
|
|
||||||
template <class R, class T>
|
template <class R, class T>
|
||||||
struct is_boost_iterator_tag<iterator_tag<R,T> >
|
struct is_boost_iterator_tag<iterator_tag<R,T> >
|
||||||
: mpl::true_c {};
|
: mpl::true_ {};
|
||||||
# else
|
# else
|
||||||
template <class T>
|
template <class T>
|
||||||
struct is_boost_iterator_tag_impl
|
struct is_boost_iterator_tag
|
||||||
{
|
{
|
||||||
typedef char (&yes)[1];
|
typedef char (&yes)[1];
|
||||||
typedef char (&no)[2];
|
typedef char (&no)[2];
|
||||||
@@ -269,12 +270,8 @@ namespace boost {
|
|||||||
|
|
||||||
static T inst;
|
static T inst;
|
||||||
BOOST_STATIC_CONSTANT(bool, value = sizeof(test(inst)) == sizeof(yes));
|
BOOST_STATIC_CONSTANT(bool, value = sizeof(test(inst)) == sizeof(yes));
|
||||||
|
typedef mpl::bool_<value> type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_boost_iterator_tag
|
|
||||||
: mpl::bool_c<is_boost_iterator_tag_impl<T>::value>
|
|
||||||
{};
|
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -132,7 +132,7 @@ namespace boost
|
|||||||
, class Traits
|
, class Traits
|
||||||
>
|
>
|
||||||
class iterator_facade
|
class iterator_facade
|
||||||
: detail::std_iterator_from_traits<Traits>
|
: public detail::std_iterator_from_traits<Traits>
|
||||||
{
|
{
|
||||||
typedef detail::std_iterator_from_traits<Traits> super_t;
|
typedef detail::std_iterator_from_traits<Traits> super_t;
|
||||||
|
|
||||||
@@ -159,34 +159,64 @@ namespace boost
|
|||||||
typedef typename super_t::pointer pointer;
|
typedef typename super_t::pointer pointer;
|
||||||
|
|
||||||
reference operator*() const
|
reference operator*() const
|
||||||
{ return iterator_core_access::dereference(this->derived()); }
|
{
|
||||||
|
return iterator_core_access::dereference(this->derived());
|
||||||
|
}
|
||||||
|
|
||||||
// Needs eventual help for input iterators
|
// Needs eventual help for input iterators
|
||||||
pointer operator->() const { return &iterator_core_access::dereference(this->derived()); }
|
pointer operator->() const
|
||||||
|
{
|
||||||
|
return &iterator_core_access::dereference(this->derived());
|
||||||
|
}
|
||||||
|
|
||||||
reference operator[](difference_type n) const
|
reference operator[](difference_type n) const
|
||||||
{ return *(*this + n); }
|
{
|
||||||
|
return *(*this + n);
|
||||||
|
}
|
||||||
|
|
||||||
Derived& operator++()
|
Derived& operator++()
|
||||||
{ iterator_core_access::increment(this->derived()); return this->derived(); }
|
{
|
||||||
|
iterator_core_access::increment(this->derived());
|
||||||
|
return this->derived();
|
||||||
|
}
|
||||||
|
|
||||||
Derived operator++(int)
|
Derived operator++(int)
|
||||||
{ Derived tmp(this->derived()); ++*this; return tmp; }
|
{
|
||||||
|
Derived tmp(this->derived());
|
||||||
|
++*this;
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
Derived& operator--()
|
Derived& operator--()
|
||||||
{ iterator_core_access::decrement(this->derived()); return this->derived(); }
|
{
|
||||||
|
iterator_core_access::decrement(this->derived());
|
||||||
|
return this->derived();
|
||||||
|
}
|
||||||
|
|
||||||
Derived operator--(int)
|
Derived operator--(int)
|
||||||
{ Derived tmp(this->derived()); --*this; return tmp; }
|
{
|
||||||
|
Derived tmp(this->derived());
|
||||||
|
--*this;
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
Derived& operator+=(difference_type n)
|
Derived& operator+=(difference_type n)
|
||||||
{ iterator_core_access::advance(this->derived(), n); return this->derived(); }
|
{
|
||||||
|
iterator_core_access::advance(this->derived(), n);
|
||||||
|
return this->derived();
|
||||||
|
}
|
||||||
|
|
||||||
Derived& operator-=(difference_type n)
|
Derived& operator-=(difference_type n)
|
||||||
{ iterator_core_access::advance(this->derived(), -n); return this->derived(); }
|
{
|
||||||
|
iterator_core_access::advance(this->derived(), -n);
|
||||||
|
return this->derived();
|
||||||
|
}
|
||||||
|
|
||||||
Derived operator-(difference_type x) const
|
Derived operator-(difference_type x) const
|
||||||
{ Derived result(this->derived()); return result -= x; }
|
{
|
||||||
|
Derived result(this->derived());
|
||||||
|
return result -= x;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
Reference in New Issue
Block a user