summaryrefslogtreecommitdiff
path: root/boost/fusion/iterator
diff options
context:
space:
mode:
Diffstat (limited to 'boost/fusion/iterator')
-rw-r--r--boost/fusion/iterator/advance.hpp4
-rw-r--r--boost/fusion/iterator/basic_iterator.hpp19
-rw-r--r--boost/fusion/iterator/deref.hpp8
-rw-r--r--boost/fusion/iterator/deref_data.hpp4
-rw-r--r--boost/fusion/iterator/detail/adapt_deref_traits.hpp2
-rw-r--r--boost/fusion/iterator/detail/advance.hpp8
-rw-r--r--boost/fusion/iterator/detail/distance.hpp2
-rw-r--r--boost/fusion/iterator/detail/segment_sequence.hpp4
-rw-r--r--boost/fusion/iterator/detail/segmented_iterator.hpp8
-rw-r--r--boost/fusion/iterator/detail/segmented_next_impl.hpp20
-rw-r--r--boost/fusion/iterator/distance.hpp2
-rw-r--r--boost/fusion/iterator/equal_to.hpp4
-rw-r--r--boost/fusion/iterator/iterator_adapter.hpp30
-rw-r--r--boost/fusion/iterator/iterator_facade.hpp10
-rw-r--r--boost/fusion/iterator/mpl/convert_iterator.hpp6
-rw-r--r--boost/fusion/iterator/next.hpp4
-rw-r--r--boost/fusion/iterator/prior.hpp4
17 files changed, 87 insertions, 52 deletions
diff --git a/boost/fusion/iterator/advance.hpp b/boost/fusion/iterator/advance.hpp
index 69b4642..f81596a 100644
--- a/boost/fusion/iterator/advance.hpp
+++ b/boost/fusion/iterator/advance.hpp
@@ -75,7 +75,7 @@ namespace boost { namespace fusion
}
template <int N, typename Iterator>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::advance_c<Iterator, N>::type const
advance_c(Iterator const& i)
{
@@ -83,7 +83,7 @@ namespace boost { namespace fusion
}
template<typename N, typename Iterator>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::advance<Iterator, N>::type const
advance(Iterator const& i)
{
diff --git a/boost/fusion/iterator/basic_iterator.hpp b/boost/fusion/iterator/basic_iterator.hpp
index bab6a4a..eae46e6 100644
--- a/boost/fusion/iterator/basic_iterator.hpp
+++ b/boost/fusion/iterator/basic_iterator.hpp
@@ -77,7 +77,7 @@ namespace boost { namespace fusion
basic_iterator<Tag, Category, Seq, Index + N::value>
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(It const& it)
{
@@ -100,7 +100,7 @@ namespace boost { namespace fusion
{
typedef mpl::minus<typename It2::index, typename It1::index> type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static
type
call(It1 const&, It2 const&)
@@ -121,18 +121,18 @@ namespace boost { namespace fusion
{};
template<typename OtherSeq>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
basic_iterator(basic_iterator<Tag,Category,OtherSeq,Index> const& it)
: seq(it.seq)
{}
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
basic_iterator(Seq& in_seq, int)
: seq(&in_seq)
{}
template<typename OtherSeq>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
basic_iterator&
operator=(basic_iterator<Tag,Category,OtherSeq,Index> const& it)
{
@@ -144,4 +144,13 @@ namespace boost { namespace fusion
};
}}
+#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
+namespace std
+{
+ template <typename Tag, typename Category, typename Seq, int Index>
+ struct iterator_traits< ::boost::fusion::basic_iterator<Tag, Category, Seq, Index> >
+ { };
+}
+#endif
+
#endif
diff --git a/boost/fusion/iterator/deref.hpp b/boost/fusion/iterator/deref.hpp
index a608b0a..c31962c 100644
--- a/boost/fusion/iterator/deref.hpp
+++ b/boost/fusion/iterator/deref.hpp
@@ -55,8 +55,8 @@ namespace boost { namespace fusion
}
template <typename Iterator>
- BOOST_FUSION_GPU_ENABLED
- typename result_of::deref<Iterator>::type
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ inline typename result_of::deref<Iterator>::type
deref(Iterator const& i)
{
typedef result_of::deref<Iterator> deref_meta;
@@ -64,8 +64,8 @@ namespace boost { namespace fusion
}
template <typename Iterator>
- BOOST_FUSION_GPU_ENABLED
- typename result_of::deref<Iterator>::type
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ inline typename result_of::deref<Iterator>::type
operator*(iterator_base<Iterator> const& i)
{
return fusion::deref(i.cast());
diff --git a/boost/fusion/iterator/deref_data.hpp b/boost/fusion/iterator/deref_data.hpp
index 0dff030..65a4332 100644
--- a/boost/fusion/iterator/deref_data.hpp
+++ b/boost/fusion/iterator/deref_data.hpp
@@ -40,8 +40,8 @@ namespace boost { namespace fusion
}
template <typename It>
- BOOST_FUSION_GPU_ENABLED
- typename result_of::deref_data<It>::type
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ inline typename result_of::deref_data<It>::type
deref_data(It const& it)
{
return result_of::deref_data<It>::call(it);
diff --git a/boost/fusion/iterator/detail/adapt_deref_traits.hpp b/boost/fusion/iterator/detail/adapt_deref_traits.hpp
index ef60055..bee0934 100644
--- a/boost/fusion/iterator/detail/adapt_deref_traits.hpp
+++ b/boost/fusion/iterator/detail/adapt_deref_traits.hpp
@@ -21,7 +21,7 @@ namespace boost { namespace fusion { namespace detail
result_of::deref<typename Iterator::first_type>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator const& i)
{
diff --git a/boost/fusion/iterator/detail/advance.hpp b/boost/fusion/iterator/detail/advance.hpp
index ace4ed4..7eb3bbb 100644
--- a/boost/fusion/iterator/detail/advance.hpp
+++ b/boost/fusion/iterator/detail/advance.hpp
@@ -45,7 +45,7 @@ namespace boost { namespace fusion { namespace advance_detail
>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type const&
call(type const& i)
{
@@ -53,7 +53,7 @@ namespace boost { namespace fusion { namespace advance_detail
}
template <typename I>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(I const& i)
{
@@ -86,7 +86,7 @@ namespace boost { namespace fusion { namespace advance_detail
>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type const&
call(type const& i)
{
@@ -94,7 +94,7 @@ namespace boost { namespace fusion { namespace advance_detail
}
template <typename I>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(I const& i)
{
diff --git a/boost/fusion/iterator/detail/distance.hpp b/boost/fusion/iterator/detail/distance.hpp
index c037995..6984902 100644
--- a/boost/fusion/iterator/detail/distance.hpp
+++ b/boost/fusion/iterator/detail/distance.hpp
@@ -53,7 +53,7 @@ namespace boost { namespace fusion { namespace distance_detail
>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(First const&, Last const&)
{
diff --git a/boost/fusion/iterator/detail/segment_sequence.hpp b/boost/fusion/iterator/detail/segment_sequence.hpp
index 90db25e..8b8d5c1 100644
--- a/boost/fusion/iterator/detail/segment_sequence.hpp
+++ b/boost/fusion/iterator/detail/segment_sequence.hpp
@@ -30,7 +30,7 @@ namespace boost { namespace fusion { namespace detail
typedef Sequence sequence_type;
sequence_type sequence;
- BOOST_FUSION_GPU_ENABLED explicit segment_sequence(Sequence const & seq)
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit segment_sequence(Sequence const & seq)
: sequence(seq)
{}
};
@@ -61,7 +61,7 @@ namespace extension
{
typedef typename Sequence::sequence_type type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Sequence & seq)
{
return seq.sequence;
diff --git a/boost/fusion/iterator/detail/segmented_iterator.hpp b/boost/fusion/iterator/detail/segmented_iterator.hpp
index 1d4f62d..9e11415 100644
--- a/boost/fusion/iterator/detail/segmented_iterator.hpp
+++ b/boost/fusion/iterator/detail/segmented_iterator.hpp
@@ -35,7 +35,7 @@ namespace boost { namespace fusion
struct segmented_iterator
: iterator_facade<segmented_iterator<Context>, forward_traversal_tag>
{
- BOOST_FUSION_GPU_ENABLED explicit segmented_iterator(Context const& ctx)
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit segmented_iterator(Context const& ctx)
: context(ctx)
{}
@@ -52,7 +52,7 @@ namespace boost { namespace fusion
>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(It const& it)
{
return *it.context.car.first;
@@ -72,7 +72,7 @@ namespace boost { namespace fusion
>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(It const& it)
{
return fusion::deref_data(it.context.car.first);
@@ -132,7 +132,7 @@ namespace boost { namespace fusion
typedef detail::segmented_next_impl<typename It::context_type> impl;
typedef segmented_iterator<typename impl::type> type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(It const& it)
{
return type(impl::call(it.context));
diff --git a/boost/fusion/iterator/detail/segmented_next_impl.hpp b/boost/fusion/iterator/detail/segmented_next_impl.hpp
index a2b75d7..62502ce 100644
--- a/boost/fusion/iterator/detail/segmented_next_impl.hpp
+++ b/boost/fusion/iterator/detail/segmented_next_impl.hpp
@@ -65,7 +65,7 @@ namespace boost { namespace fusion
cons<car_type, typename Stack::cdr_type>
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const & stack)
{
return type(
@@ -98,7 +98,7 @@ namespace boost { namespace fusion
typedef segmented_next_impl_recurse<typename Stack::cdr_type> impl;
typedef typename impl::type type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const & stack)
{
return impl::call(stack.cdr);
@@ -112,7 +112,7 @@ namespace boost { namespace fusion
typedef iterator_range<end_type, end_type> range_type;
typedef cons<range_type> type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const & stack)
{
return type(range_type(stack.car.last, stack.car.last));
@@ -147,7 +147,7 @@ namespace boost { namespace fusion
typedef segmented_next_impl_recurse3<Stack> impl;
typedef typename impl::type type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const & stack)
{
return impl::call(stack);
@@ -159,7 +159,7 @@ namespace boost { namespace fusion
{
typedef Result type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const & stack)
{
return segmented_begin_impl<Sequence, Stack>::call(*stack.car.first, stack);
@@ -185,7 +185,7 @@ namespace boost { namespace fusion
typename segmented_next_impl_recurse<typename Stack::cdr_type>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const& stack)
{
return segmented_next_impl_recurse<typename Stack::cdr_type>::call(stack.cdr);
@@ -197,7 +197,7 @@ namespace boost { namespace fusion
{
typedef Next type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const & stack)
{
return pop_front_car<Stack>::call(stack);
@@ -210,7 +210,7 @@ namespace boost { namespace fusion
typedef segmented_next_impl_recurse2<Next> impl;
typedef typename impl::type type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const & stack)
{
return impl::call(pop_front_car<Stack>::call(stack));
@@ -236,7 +236,7 @@ namespace boost { namespace fusion
typedef segmented_next_impl_recurse<typename Stack::cdr_type> impl;
typedef typename impl::type type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const & stack)
{
return impl::call(stack.cdr);
@@ -248,7 +248,7 @@ namespace boost { namespace fusion
{
typedef Next type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const & stack)
{
return pop_front_car<Stack>::call(stack);
diff --git a/boost/fusion/iterator/distance.hpp b/boost/fusion/iterator/distance.hpp
index afca6a3..7f993c0 100644
--- a/boost/fusion/iterator/distance.hpp
+++ b/boost/fusion/iterator/distance.hpp
@@ -69,7 +69,7 @@ namespace boost { namespace fusion
}
template <typename First, typename Last>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::distance<First, Last>::type
distance(First const& a, Last const& b)
{
diff --git a/boost/fusion/iterator/equal_to.hpp b/boost/fusion/iterator/equal_to.hpp
index 1927ce7..191795e 100644
--- a/boost/fusion/iterator/equal_to.hpp
+++ b/boost/fusion/iterator/equal_to.hpp
@@ -74,7 +74,7 @@ namespace boost { namespace fusion
namespace iterator_operators
{
template <typename Iter1, typename Iter2>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename
boost::enable_if<
mpl::and_<is_fusion_iterator<Iter1>, is_fusion_iterator<Iter2> >
@@ -86,7 +86,7 @@ namespace boost { namespace fusion
}
template <typename Iter1, typename Iter2>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename
boost::enable_if<
mpl::and_<is_fusion_iterator<Iter1>, is_fusion_iterator<Iter2> >
diff --git a/boost/fusion/iterator/iterator_adapter.hpp b/boost/fusion/iterator/iterator_adapter.hpp
index af6978b..de8938f 100644
--- a/boost/fusion/iterator/iterator_adapter.hpp
+++ b/boost/fusion/iterator/iterator_adapter.hpp
@@ -8,14 +8,21 @@
#define FUSION_ITERATOR_ADAPTER_08112011_0942
#include <boost/fusion/support/config.hpp>
-#include <boost/fusion/iterator/detail/advance.hpp>
+#include <boost/fusion/support/category_of.hpp>
+#include <boost/fusion/iterator/advance.hpp>
+#include <boost/fusion/iterator/deref.hpp>
+#include <boost/fusion/iterator/distance.hpp>
+#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/iterator/iterator_facade.hpp>
+#include <boost/fusion/iterator/next.hpp>
+#include <boost/fusion/iterator/prior.hpp>
+#include <boost/fusion/iterator/value_of.hpp>
#include <boost/type_traits/remove_const.hpp>
namespace boost { namespace fusion
{
template <typename Derived_, typename Iterator_,
- typename Category = typename Iterator_::category>
+ typename Category = typename traits::category_of<Iterator_>::type>
struct iterator_adapter
: iterator_facade<Derived_, Category>
{
@@ -24,7 +31,7 @@ namespace boost { namespace fusion
iterator_base_type;
iterator_base_type iterator_base;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
iterator_adapter(iterator_base_type const& iterator_base_)
: iterator_base(iterator_base_) {}
@@ -47,7 +54,7 @@ namespace boost { namespace fusion
>::type>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator const& it)
{
@@ -82,7 +89,7 @@ namespace boost { namespace fusion
>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator const& it)
{
@@ -100,7 +107,7 @@ namespace boost { namespace fusion
>::type>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator const& i)
{
@@ -118,7 +125,7 @@ namespace boost { namespace fusion
>::type>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator const& i)
{
@@ -128,4 +135,13 @@ namespace boost { namespace fusion
};
}}
+#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
+namespace std
+{
+ template <typename Derived, typename Iterator, typename Category>
+ struct iterator_traits< ::boost::fusion::iterator_adapter<Derived, Iterator, Category> >
+ { };
+}
+#endif
+
#endif
diff --git a/boost/fusion/iterator/iterator_facade.hpp b/boost/fusion/iterator/iterator_facade.hpp
index 415e841..1760957 100644
--- a/boost/fusion/iterator/iterator_facade.hpp
+++ b/boost/fusion/iterator/iterator_facade.hpp
@@ -14,6 +14,7 @@
#include <boost/fusion/support/category_of.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/mpl/assert.hpp>
+#include <boost/mpl/if.hpp>
namespace boost { namespace fusion
{
@@ -55,4 +56,13 @@ namespace boost { namespace fusion
};
}}
+#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
+namespace std
+{
+ template <typename Derived, typename Category>
+ struct iterator_traits< ::boost::fusion::iterator_facade<Derived, Category> >
+ { };
+}
+#endif
+
#endif
diff --git a/boost/fusion/iterator/mpl/convert_iterator.hpp b/boost/fusion/iterator/mpl/convert_iterator.hpp
index 54c9ef6..3e17478 100644
--- a/boost/fusion/iterator/mpl/convert_iterator.hpp
+++ b/boost/fusion/iterator/mpl/convert_iterator.hpp
@@ -31,21 +31,21 @@ namespace boost { namespace fusion
>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static T const&
call(T const& x, mpl::true_)
{
return x;
}
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static mpl_iterator<T>
call(T const& /*x*/, mpl::false_)
{
return mpl_iterator<T>();
}
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static typename
mpl::if_<
is_fusion_iterator<T>
diff --git a/boost/fusion/iterator/next.hpp b/boost/fusion/iterator/next.hpp
index bd76eac..d6ca3d6 100644
--- a/boost/fusion/iterator/next.hpp
+++ b/boost/fusion/iterator/next.hpp
@@ -54,8 +54,8 @@ namespace boost { namespace fusion
}
template <typename Iterator>
- BOOST_FUSION_GPU_ENABLED
- typename result_of::next<Iterator>::type const
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ inline typename result_of::next<Iterator>::type const
next(Iterator const& i)
{
return result_of::next<Iterator>::call(i);
diff --git a/boost/fusion/iterator/prior.hpp b/boost/fusion/iterator/prior.hpp
index 78d8390..80e891c 100644
--- a/boost/fusion/iterator/prior.hpp
+++ b/boost/fusion/iterator/prior.hpp
@@ -54,8 +54,8 @@ namespace boost { namespace fusion
}
template <typename Iterator>
- BOOST_FUSION_GPU_ENABLED
- typename result_of::prior<Iterator>::type const
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ inline typename result_of::prior<Iterator>::type const
prior(Iterator const& i)
{
return result_of::prior<Iterator>::call(i);