stabilize build system: depends, installer, boost/bdb fixes, cross targets groundwork
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2006 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_STRICTEST_TRAVERSAL_20060123_2101)
|
||||
#define FUSION_STRICTEST_TRAVERSAL_20060123_2101
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/mpl/or.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/fusion/support/category_of.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/algorithm/iteration/fold.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct forward_traversal_tag;
|
||||
struct bidirectional_traversal_tag;
|
||||
struct random_access_traversal_tag;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template<typename Tag1, typename Tag2,
|
||||
bool Tag1Stricter = boost::is_convertible<Tag2,Tag1>::value>
|
||||
struct stricter_traversal
|
||||
{
|
||||
typedef Tag1 type;
|
||||
};
|
||||
|
||||
template<typename Tag1, typename Tag2>
|
||||
struct stricter_traversal<Tag1,Tag2,false>
|
||||
{
|
||||
typedef Tag2 type;
|
||||
};
|
||||
|
||||
struct strictest_traversal_impl
|
||||
{
|
||||
template<typename Sig>
|
||||
struct result;
|
||||
|
||||
template<typename StrictestSoFar, typename Next>
|
||||
struct result<strictest_traversal_impl(StrictestSoFar, Next)>
|
||||
{
|
||||
typedef typename remove_reference<Next>::type next_value;
|
||||
typedef typename remove_reference<StrictestSoFar>::type strictest_so_far;
|
||||
|
||||
typedef strictest_so_far tag1;
|
||||
typedef typename traits::category_of<next_value>::type tag2;
|
||||
|
||||
typedef typename stricter_traversal<tag1,tag2>::type type;
|
||||
};
|
||||
|
||||
// never called, but needed for decltype-based result_of (C++0x)
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template<typename StrictestSoFar, typename Next>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
typename result<strictest_traversal_impl(StrictestSoFar, Next)>::type
|
||||
operator()(StrictestSoFar&&, Next&&) const;
|
||||
#endif
|
||||
};
|
||||
|
||||
template<typename Sequence>
|
||||
struct strictest_traversal
|
||||
: result_of::fold<
|
||||
Sequence, fusion::random_access_traversal_tag,
|
||||
strictest_traversal_impl>
|
||||
{};
|
||||
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,14 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_SEQUENCE_VIEW_FILTER_VIEW_10022005_0608)
|
||||
#define FUSION_SEQUENCE_VIEW_FILTER_VIEW_10022005_0608
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/view/filter_view/filter_view.hpp>
|
||||
#include <boost/fusion/view/filter_view/filter_view_iterator.hpp>
|
||||
|
||||
#endif
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_BEGIN_IMPL_05062005_0903)
|
||||
#define FUSION_BEGIN_IMPL_05062005_0903
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct filter_view_tag;
|
||||
|
||||
template <typename Category, typename First, typename Last, typename Pred>
|
||||
struct filter_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct begin_impl;
|
||||
|
||||
template <>
|
||||
struct begin_impl<filter_view_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Sequence::first_type first_type;
|
||||
typedef typename Sequence::last_type last_type;
|
||||
typedef typename Sequence::pred_type pred_type;
|
||||
typedef typename Sequence::category category;
|
||||
typedef filter_iterator<category, first_type, last_type, pred_type> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence& s)
|
||||
{
|
||||
return type(s.first());
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_DEREF_DATA_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_DEREF_DATA_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/deref_data.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct deref_data_impl;
|
||||
|
||||
template <>
|
||||
struct deref_data_impl<filter_view_iterator_tag>
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
{
|
||||
typedef typename
|
||||
result_of::deref_data<typename It::first_type>::type
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(It const& it)
|
||||
{
|
||||
return fusion::deref_data(it.first);
|
||||
}
|
||||
};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_DEREF_IMPL_05062005_0905)
|
||||
#define FUSION_DEREF_IMPL_05062005_0905
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/detail/adapt_deref_traits.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct filter_view_iterator_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct deref_impl;
|
||||
|
||||
template <>
|
||||
struct deref_impl<filter_view_iterator_tag>
|
||||
: detail::adapt_deref_traits {};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_END_IMPL_05062005_0906)
|
||||
#define FUSION_END_IMPL_05062005_0906
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct filter_view_tag;
|
||||
|
||||
template <typename Category, typename First, typename Last, typename Pred>
|
||||
struct filter_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct end_impl;
|
||||
|
||||
template <>
|
||||
struct end_impl<filter_view_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Sequence::last_type last_type;
|
||||
typedef typename Sequence::pred_type pred_type;
|
||||
typedef typename Sequence::category category;
|
||||
typedef filter_iterator<category,last_type, last_type, pred_type> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence& s)
|
||||
{
|
||||
return type(s.last());
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_EQUAL_TO_IMPL_02012005_2133)
|
||||
#define BOOST_FUSION_EQUAL_TO_IMPL_02012005_2133
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct filter_view_iterator_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename I1, typename I2>
|
||||
struct equal_to;
|
||||
|
||||
template<typename Tag>
|
||||
struct equal_to_impl;
|
||||
|
||||
template<>
|
||||
struct equal_to_impl<filter_view_iterator_tag>
|
||||
{
|
||||
template<typename I1, typename I2>
|
||||
struct apply
|
||||
: result_of::equal_to<typename I1::first_type, typename I2::first_type>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_KEY_OF_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_KEY_OF_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/key_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct key_of_impl;
|
||||
|
||||
template <>
|
||||
struct key_of_impl<filter_view_iterator_tag>
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
: result_of::key_of<typename It::first_type>
|
||||
{};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_NEXT_IMPL_06052005_0900)
|
||||
#define FUSION_NEXT_IMPL_06052005_0900
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/algorithm/query/detail/find_if.hpp>
|
||||
#include <boost/fusion/iterator/value_of.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/mpl/lambda.hpp>
|
||||
#include <boost/mpl/quote.hpp>
|
||||
#include <boost/mpl/bind.hpp>
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct filter_view_iterator_tag;
|
||||
|
||||
template <typename Category, typename First, typename Last, typename Pred>
|
||||
struct filter_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct next_impl;
|
||||
|
||||
template <>
|
||||
struct next_impl<filter_view_iterator_tag>
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Iterator::first_type first_type;
|
||||
typedef typename Iterator::last_type last_type;
|
||||
typedef typename Iterator::pred_type pred_type;
|
||||
typedef typename Iterator::category category;
|
||||
|
||||
typedef typename
|
||||
mpl::eval_if<
|
||||
result_of::equal_to<first_type, last_type>
|
||||
, mpl::identity<last_type>
|
||||
, result_of::next<first_type>
|
||||
>::type
|
||||
next_type;
|
||||
|
||||
typedef typename
|
||||
detail::static_find_if<
|
||||
next_type
|
||||
, last_type
|
||||
, mpl::bind1<
|
||||
typename mpl::lambda<pred_type>::type
|
||||
, mpl::bind1<mpl::quote1<result_of::value_of>,mpl::_1>
|
||||
>
|
||||
>
|
||||
filter;
|
||||
|
||||
typedef filter_iterator<
|
||||
category, typename filter::type, last_type, pred_type>
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type(filter::iter_call(i.first));
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_SIZE_IMPL_09232005_1058)
|
||||
#define FUSION_SIZE_IMPL_09232005_1058
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/distance.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct filter_view_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct size_impl;
|
||||
|
||||
template <>
|
||||
struct size_impl<filter_view_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
: result_of::distance<
|
||||
typename result_of::begin<Sequence>::type
|
||||
, typename result_of::end<Sequence>::type>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/value_of_data.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct value_of_data_impl;
|
||||
|
||||
template <>
|
||||
struct value_of_data_impl<filter_view_iterator_tag>
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
: result_of::value_of_data<typename It::first_type>
|
||||
{};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_VALUE_OF_IMPL_05062005_0857)
|
||||
#define FUSION_VALUE_OF_IMPL_05062005_0857
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/detail/adapt_value_traits.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct filter_view_iterator_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct value_of_impl;
|
||||
|
||||
template <>
|
||||
struct value_of_impl<filter_view_iterator_tag>
|
||||
: detail::adapt_value_traits {};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_SEQUENCE_FILTER_VIEW_HPP)
|
||||
#define FUSION_SEQUENCE_FILTER_VIEW_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/fusion/support/sequence_base.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/fusion/view/filter_view/filter_view_iterator.hpp>
|
||||
#include <boost/fusion/view/filter_view/detail/begin_impl.hpp>
|
||||
#include <boost/fusion/view/filter_view/detail/end_impl.hpp>
|
||||
#include <boost/fusion/view/filter_view/detail/size_impl.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/inherit.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct filter_view_tag;
|
||||
struct forward_traversal_tag;
|
||||
struct fusion_sequence_tag;
|
||||
|
||||
template <typename Sequence, typename Pred>
|
||||
struct filter_view : sequence_base<filter_view<Sequence, Pred> >
|
||||
{
|
||||
typedef filter_view_tag fusion_tag;
|
||||
typedef fusion_sequence_tag tag; // this gets picked up by MPL
|
||||
typedef typename
|
||||
mpl::eval_if<
|
||||
traits::is_associative<Sequence>
|
||||
, mpl::inherit2<forward_traversal_tag,associative_tag>
|
||||
, mpl::identity<forward_traversal_tag>
|
||||
>::type
|
||||
category;
|
||||
typedef mpl::true_ is_view;
|
||||
|
||||
typedef typename result_of::begin<Sequence>::type first_type;
|
||||
typedef typename result_of::end<Sequence>::type last_type;
|
||||
typedef Pred pred_type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
filter_view(Sequence& in_seq)
|
||||
: seq(in_seq)
|
||||
{}
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
first_type first() const { return fusion::begin(seq); }
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
last_type last() const { return fusion::end(seq); }
|
||||
typename mpl::if_<traits::is_view<Sequence>, Sequence, Sequence&>::type seq;
|
||||
|
||||
private:
|
||||
// silence MSVC warning C4512: assignment operator could not be generated
|
||||
filter_view& operator= (filter_view const&);
|
||||
};
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_FILTER_VIEW_ITERATOR_05062005_0849)
|
||||
#define FUSION_FILTER_VIEW_ITERATOR_05062005_0849
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/mpl/convert_iterator.hpp>
|
||||
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
|
||||
#include <boost/fusion/iterator/value_of.hpp>
|
||||
#include <boost/fusion/support/iterator_base.hpp>
|
||||
#include <boost/fusion/algorithm/query/detail/find_if.hpp>
|
||||
#include <boost/mpl/lambda.hpp>
|
||||
#include <boost/mpl/quote.hpp>
|
||||
#include <boost/mpl/bind.hpp>
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
|
||||
#include <boost/fusion/view/filter_view/detail/deref_impl.hpp>
|
||||
#include <boost/fusion/view/filter_view/detail/next_impl.hpp>
|
||||
#include <boost/fusion/view/filter_view/detail/value_of_impl.hpp>
|
||||
#include <boost/fusion/view/filter_view/detail/equal_to_impl.hpp>
|
||||
#include <boost/fusion/view/filter_view/detail/deref_data_impl.hpp>
|
||||
#include <boost/fusion/view/filter_view/detail/value_of_data_impl.hpp>
|
||||
#include <boost/fusion/view/filter_view/detail/key_of_impl.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct filter_view_iterator_tag;
|
||||
struct forward_traversal_tag;
|
||||
|
||||
template <typename Category, typename First, typename Last, typename Pred>
|
||||
struct filter_iterator : iterator_base<filter_iterator<Category, First, Last, Pred> >
|
||||
{
|
||||
typedef convert_iterator<First> first_converter;
|
||||
typedef typename first_converter::type first_iter;
|
||||
typedef convert_iterator<Last> last_converter;
|
||||
typedef typename last_converter::type last_iter;
|
||||
|
||||
typedef filter_view_iterator_tag fusion_tag;
|
||||
typedef Category category;
|
||||
typedef
|
||||
detail::static_find_if<
|
||||
first_iter
|
||||
, last_iter
|
||||
, mpl::bind1<
|
||||
typename mpl::lambda<Pred>::type
|
||||
, mpl::bind1<mpl::quote1<result_of::value_of>,mpl::_1>
|
||||
>
|
||||
>
|
||||
filter;
|
||||
typedef typename filter::type first_type;
|
||||
typedef last_iter last_type;
|
||||
typedef Pred pred_type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
filter_iterator(First const& in_first)
|
||||
: first(filter::iter_call(first_converter::call(in_first))) {}
|
||||
|
||||
first_type first;
|
||||
|
||||
private:
|
||||
// silence MSVC warning C4512: assignment operator could not be generated
|
||||
filter_iterator& operator= (filter_iterator const&);
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Category, typename First, typename Last, typename Pred>
|
||||
struct iterator_traits< ::boost::fusion::filter_iterator<Category, First, Last, Pred> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/*==============================================================================
|
||||
Copyright (c) 2013 Jamboree
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#ifndef BOOST_FUSION_SEQUENCE_FLATTEN_VIEW_HPP_INCLUDED
|
||||
#define BOOST_FUSION_SEQUENCE_FLATTEN_VIEW_HPP_INCLUDED
|
||||
|
||||
|
||||
#include <boost/fusion/view/flatten_view/flatten_view.hpp>
|
||||
#include <boost/fusion/view/flatten_view/flatten_view_iterator.hpp>
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,133 @@
|
||||
/*==============================================================================
|
||||
Copyright (c) 2013 Jamboree
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#ifndef BOOST_FUSION_FLATTEN_VIEW_HPP_INCLUDED
|
||||
#define BOOST_FUSION_FLATTEN_VIEW_HPP_INCLUDED
|
||||
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/single_view.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/fusion/support/category_of.hpp>
|
||||
#include <boost/fusion/support/sequence_base.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/view/flatten_view/flatten_view_iterator.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct forward_traversal_tag;
|
||||
struct flatten_view_tag;
|
||||
|
||||
template <typename Sequence>
|
||||
struct flatten_view
|
||||
: sequence_base<flatten_view<Sequence> >
|
||||
{
|
||||
typedef flatten_view_tag fusion_tag;
|
||||
typedef fusion_sequence_tag tag; // this gets picked up by MPL
|
||||
typedef mpl::true_ is_view;
|
||||
typedef forward_traversal_tag category;
|
||||
|
||||
typedef Sequence sequence_type;
|
||||
typedef typename result_of::begin<Sequence>::type first_type;
|
||||
typedef typename result_of::end<Sequence>::type last_type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit flatten_view(Sequence& seq)
|
||||
: seq(seq)
|
||||
{}
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
first_type first() const { return fusion::begin(seq); }
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
last_type last() const { return fusion::end(seq); }
|
||||
|
||||
typename mpl::if_<traits::is_view<Sequence>, Sequence, Sequence&>::type seq;
|
||||
};
|
||||
}}
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template<>
|
||||
struct begin_impl<flatten_view_tag>
|
||||
{
|
||||
template<typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Sequence::first_type first_type;
|
||||
|
||||
typedef typename
|
||||
result_of::begin<
|
||||
mpl::single_view<
|
||||
typename Sequence::sequence_type> >::type
|
||||
root_iterator;
|
||||
|
||||
typedef
|
||||
detail::seek_descent<root_iterator, first_type>
|
||||
seek_descent;
|
||||
|
||||
typedef typename seek_descent::type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static inline
|
||||
type call(Sequence& seq)
|
||||
{
|
||||
return seek_descent::apply(root_iterator(), seq.first());
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct end_impl<flatten_view_tag>
|
||||
{
|
||||
template<typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Sequence::last_type last_type;
|
||||
|
||||
typedef typename
|
||||
result_of::end<
|
||||
mpl::single_view<
|
||||
typename Sequence::sequence_type> >::type
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static inline
|
||||
type call(Sequence&)
|
||||
{
|
||||
return type();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct size_impl<flatten_view_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
: result_of::distance
|
||||
<
|
||||
typename result_of::begin<Sequence>::type
|
||||
, typename result_of::end<Sequence>::type
|
||||
>
|
||||
{};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct empty_impl<flatten_view_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
: result_of::empty<typename Sequence::sequence_type>
|
||||
{};
|
||||
};
|
||||
}}}
|
||||
|
||||
|
||||
#endif
|
||||
+218
@@ -0,0 +1,218 @@
|
||||
/*==============================================================================
|
||||
Copyright (c) 2013 Jamboree
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#ifndef BOOST_FUSION_FLATTEN_VIEW_ITERATOR_HPP_INCLUDED
|
||||
#define BOOST_FUSION_FLATTEN_VIEW_ITERATOR_HPP_INCLUDED
|
||||
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/fusion/container/list/cons.hpp>
|
||||
#include <boost/fusion/support/unused.hpp>
|
||||
#include <boost/fusion/include/equal_to.hpp>
|
||||
#include <boost/fusion/iterator/next.hpp>
|
||||
#include <boost/fusion/iterator/deref.hpp>
|
||||
#include <boost/fusion/iterator/value_of.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct forward_traversal_tag;
|
||||
struct flatten_view_iterator_tag;
|
||||
|
||||
template<class First, class Base>
|
||||
struct flatten_view_iterator
|
||||
: iterator_base<flatten_view_iterator<First, Base> >
|
||||
{
|
||||
typedef flatten_view_iterator_tag fusion_tag;
|
||||
typedef forward_traversal_tag category;
|
||||
|
||||
typedef convert_iterator<First> first_converter;
|
||||
typedef typename first_converter::type first_type;
|
||||
typedef Base base_type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
flatten_view_iterator(First const& first, Base const& base)
|
||||
: first(first), base(base)
|
||||
{}
|
||||
|
||||
first_type first;
|
||||
base_type base;
|
||||
};
|
||||
}}
|
||||
|
||||
namespace boost { namespace fusion { namespace detail
|
||||
{
|
||||
template<class Iterator, class = void>
|
||||
struct make_descent_cons
|
||||
{
|
||||
typedef cons<Iterator> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static inline type apply(Iterator const& it)
|
||||
{
|
||||
return type(it);
|
||||
}
|
||||
};
|
||||
|
||||
template<class Iterator>
|
||||
struct make_descent_cons<Iterator,
|
||||
typename enable_if<traits::is_sequence<
|
||||
typename result_of::value_of<Iterator>::type> >::type>
|
||||
{
|
||||
// we use 'value_of' above for convenience, assuming the value won't be reference,
|
||||
// while we must use the regular 'deref' here for const issues...
|
||||
typedef typename
|
||||
remove_reference<typename result_of::deref<Iterator>::type>::type
|
||||
sub_sequence;
|
||||
|
||||
typedef typename
|
||||
result_of::begin<sub_sequence>::type
|
||||
sub_begin;
|
||||
|
||||
typedef cons<Iterator, typename make_descent_cons<sub_begin>::type> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static inline type apply(Iterator const& it)
|
||||
{
|
||||
return type(it, make_descent_cons<sub_begin>::apply(
|
||||
fusion::begin(*it)));
|
||||
}
|
||||
};
|
||||
|
||||
template<class Cons, class Base>
|
||||
struct build_flatten_view_iterator;
|
||||
|
||||
template<class Car, class Base>
|
||||
struct build_flatten_view_iterator<cons<Car>, Base>
|
||||
{
|
||||
typedef flatten_view_iterator<Car, Base> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static inline type apply(cons<Car> const& cons, Base const& base)
|
||||
{
|
||||
return type(cons.car, base);
|
||||
}
|
||||
};
|
||||
|
||||
template<class Car, class Cdr, class Base>
|
||||
struct build_flatten_view_iterator<cons<Car, Cdr>, Base>
|
||||
{
|
||||
typedef flatten_view_iterator<Car, Base> next_base;
|
||||
typedef build_flatten_view_iterator<Cdr, next_base> next;
|
||||
typedef typename next::type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static inline type apply(cons<Car, Cdr> const& cons, Base const& base)
|
||||
{
|
||||
return next::apply(cons.cdr, next_base(cons.car, base));
|
||||
}
|
||||
};
|
||||
|
||||
template<class Base, class Iterator, class = void>
|
||||
struct seek_descent
|
||||
{
|
||||
typedef make_descent_cons<Iterator> make_descent_cons_;
|
||||
typedef typename make_descent_cons_::type cons_type;
|
||||
typedef
|
||||
build_flatten_view_iterator<cons_type, Base>
|
||||
build_flatten_view_iterator_;
|
||||
typedef typename build_flatten_view_iterator_::type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static inline type apply(Base const& base, Iterator const& it)
|
||||
{
|
||||
return build_flatten_view_iterator_::apply(
|
||||
make_descent_cons_::apply(it), base);
|
||||
}
|
||||
};
|
||||
|
||||
template<class Base, class Iterator>
|
||||
struct seek_descent<Base, Iterator,
|
||||
typename enable_if<
|
||||
result_of::equal_to<Iterator, typename result_of::end<
|
||||
typename result_of::value_of<Base>::type>::type> >::type>
|
||||
{
|
||||
typedef typename result_of::next<Base>::type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static inline type apply(Base const& base, Iterator const&)
|
||||
{
|
||||
return fusion::next(base);
|
||||
}
|
||||
};
|
||||
}}}
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template<>
|
||||
struct next_impl<flatten_view_iterator_tag>
|
||||
{
|
||||
template<typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Iterator::first_type first_type;
|
||||
typedef typename Iterator::base_type base_type;
|
||||
typedef typename result_of::next<first_type>::type next_type;
|
||||
|
||||
typedef detail::seek_descent<base_type, next_type> seek_descent;
|
||||
typedef typename seek_descent::type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static inline
|
||||
type call(Iterator const& it)
|
||||
{
|
||||
return seek_descent::apply(it.base, fusion::next(it.first));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct deref_impl<flatten_view_iterator_tag>
|
||||
{
|
||||
template<typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef typename
|
||||
result_of::deref<typename Iterator::first_type>::type
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static inline
|
||||
type call(Iterator const& it)
|
||||
{
|
||||
return *it.first;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct value_of_impl<flatten_view_iterator_tag>
|
||||
{
|
||||
template<typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef typename
|
||||
result_of::value_of<typename Iterator::first_type>::type
|
||||
type;
|
||||
};
|
||||
};
|
||||
}}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename First, typename Base>
|
||||
struct iterator_traits< ::boost::fusion::flatten_view_iterator<First, Base> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_SEQUENCE_VIEW_ITERATOR_RANGE_10022005_0610)
|
||||
#define FUSION_SEQUENCE_VIEW_ITERATOR_RANGE_10022005_0610
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/view/iterator_range/iterator_range.hpp>
|
||||
|
||||
#endif
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2007 Tobias Schwinger
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_ITERATOR_RANGE_AT_IMPL_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_ITERATOR_RANGE_AT_IMPL_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/advance.hpp>
|
||||
#include <boost/fusion/iterator/deref.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct iterator_range_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct at_impl;
|
||||
|
||||
template <>
|
||||
struct at_impl<iterator_range_tag>
|
||||
{
|
||||
template <typename Seq, typename N>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Seq::begin_type begin_type;
|
||||
typedef typename result_of::advance<begin_type,N>::type pos;
|
||||
typedef typename result_of::deref<pos>::type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Seq& s)
|
||||
{
|
||||
return * fusion::advance<N>(s.first);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_BEGIN_IMPL_05062005_1226)
|
||||
#define FUSION_BEGIN_IMPL_05062005_1226
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct iterator_range_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct begin_impl;
|
||||
|
||||
template <>
|
||||
struct begin_impl<iterator_range_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Sequence::begin_type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence& s)
|
||||
{
|
||||
return s.first;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_END_IMPL_05062005_1226)
|
||||
#define FUSION_END_IMPL_05062005_1226
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct iterator_range_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct end_impl;
|
||||
|
||||
template <>
|
||||
struct end_impl<iterator_range_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Sequence::end_type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence& s)
|
||||
{
|
||||
return s.last;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_ITERATOR_RANGE_IS_SEGMENTED_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_ITERATOR_RANGE_IS_SEGMENTED_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct iterator_range_tag;
|
||||
|
||||
template <typename Context>
|
||||
struct segmented_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct is_segmented_impl;
|
||||
|
||||
// An iterator_range of segmented_iterators is segmented
|
||||
template <>
|
||||
struct is_segmented_impl<iterator_range_tag>
|
||||
{
|
||||
private:
|
||||
template <typename Iterator>
|
||||
struct is_segmented_iterator
|
||||
: mpl::false_
|
||||
{};
|
||||
|
||||
template <typename Iterator>
|
||||
struct is_segmented_iterator<Iterator &>
|
||||
: is_segmented_iterator<Iterator>
|
||||
{};
|
||||
|
||||
template <typename Iterator>
|
||||
struct is_segmented_iterator<Iterator const>
|
||||
: is_segmented_iterator<Iterator>
|
||||
{};
|
||||
|
||||
template <typename Context>
|
||||
struct is_segmented_iterator<segmented_iterator<Context> >
|
||||
: mpl::true_
|
||||
{};
|
||||
|
||||
public:
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
: is_segmented_iterator<typename Sequence::begin_type>
|
||||
{
|
||||
BOOST_MPL_ASSERT_RELATION(
|
||||
is_segmented_iterator<typename Sequence::begin_type>::value
|
||||
, ==
|
||||
, is_segmented_iterator<typename Sequence::end_type>::value);
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+556
@@ -0,0 +1,556 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_SEGMENTED_ITERATOR_RANGE_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_SEGMENTED_ITERATOR_RANGE_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/fusion/support/tag_of.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/iterator/next.hpp>
|
||||
#include <boost/fusion/iterator/deref.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/segments.hpp>
|
||||
#include <boost/fusion/algorithm/transformation/push_back.hpp>
|
||||
#include <boost/fusion/algorithm/transformation/push_front.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/list/detail/reverse_cons.hpp>
|
||||
#include <boost/fusion/iterator/detail/segment_sequence.hpp>
|
||||
#include <boost/fusion/support/is_sequence.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
|
||||
// Invariants:
|
||||
// - Each segmented iterator has a stack
|
||||
// - Each value in the stack is an iterator range
|
||||
// - The range at the top of the stack points to values
|
||||
// - All other ranges point to ranges
|
||||
// - The front of each range in the stack (besides the
|
||||
// topmost) is the range above it
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
template <typename First, typename Last>
|
||||
struct iterator_range;
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence, typename T>
|
||||
struct push_back;
|
||||
|
||||
template <typename Sequence, typename T>
|
||||
struct push_front;
|
||||
}
|
||||
|
||||
template <typename Sequence, typename T>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename
|
||||
lazy_enable_if<
|
||||
traits::is_sequence<Sequence>
|
||||
, result_of::push_back<Sequence const, T>
|
||||
>::type
|
||||
push_back(Sequence const& seq, T const& x);
|
||||
|
||||
template <typename Sequence, typename T>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename
|
||||
lazy_enable_if<
|
||||
traits::is_sequence<Sequence>
|
||||
, result_of::push_front<Sequence const, T>
|
||||
>::type
|
||||
push_front(Sequence const& seq, T const& x);
|
||||
}}
|
||||
|
||||
namespace boost { namespace fusion { namespace detail
|
||||
{
|
||||
//auto make_segment_sequence_front(stack_begin)
|
||||
//{
|
||||
// switch (size(stack_begin))
|
||||
// {
|
||||
// case 1:
|
||||
// return nil_;
|
||||
// case 2:
|
||||
// // car(cdr(stack_begin)) is a range over values.
|
||||
// assert(end(front(car(stack_begin))) == end(car(cdr(stack_begin))));
|
||||
// return iterator_range(begin(car(cdr(stack_begin))), end(front(car(stack_begin))));
|
||||
// default:
|
||||
// // car(cdr(stack_begin)) is a range over segments. We replace the
|
||||
// // front with a view that is restricted.
|
||||
// assert(end(segments(front(car(stack_begin)))) == end(car(cdr(stack_begin))));
|
||||
// return segment_sequence(
|
||||
// push_front(
|
||||
// // The following could be a segment_sequence. It then gets wrapped
|
||||
// // in a single_view, and push_front puts it in a join_view with the
|
||||
// // following iterator_range.
|
||||
// iterator_range(next(begin(car(cdr(stack_begin)))), end(segments(front(car(stack_begin))))),
|
||||
// make_segment_sequence_front(cdr(stack_begin))));
|
||||
// }
|
||||
//}
|
||||
|
||||
template <typename Stack, std::size_t Size = Stack::size::value>
|
||||
struct make_segment_sequence_front
|
||||
{
|
||||
// assert(end(segments(front(car(stack_begin)))) == end(car(cdr(stack_begin))));
|
||||
BOOST_MPL_ASSERT((
|
||||
result_of::equal_to<
|
||||
typename result_of::end<
|
||||
typename remove_reference<
|
||||
typename add_const<
|
||||
typename result_of::segments<
|
||||
typename remove_reference<
|
||||
typename add_const<
|
||||
typename result_of::deref<
|
||||
typename Stack::car_type::begin_type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
, typename Stack::cdr_type::car_type::end_type
|
||||
>));
|
||||
|
||||
typedef
|
||||
iterator_range<
|
||||
typename result_of::next<
|
||||
typename Stack::cdr_type::car_type::begin_type
|
||||
>::type
|
||||
, typename result_of::end<
|
||||
typename remove_reference<
|
||||
typename add_const<
|
||||
typename result_of::segments<
|
||||
typename remove_reference<
|
||||
typename add_const<
|
||||
typename result_of::deref<
|
||||
typename Stack::car_type::begin_type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>
|
||||
rest_type;
|
||||
|
||||
typedef
|
||||
make_segment_sequence_front<typename Stack::cdr_type>
|
||||
recurse;
|
||||
|
||||
typedef
|
||||
segment_sequence<
|
||||
typename result_of::push_front<
|
||||
rest_type const
|
||||
, typename recurse::type
|
||||
>::type
|
||||
>
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Stack const& stack)
|
||||
{
|
||||
//return segment_sequence(
|
||||
// push_front(
|
||||
// iterator_range(next(begin(car(cdr(stack_begin)))), end(segments(front(car(stack_begin))))),
|
||||
// make_segment_sequence_front(cdr(stack_begin))));
|
||||
return type(
|
||||
fusion::push_front(
|
||||
rest_type(fusion::next(stack.cdr.car.first), fusion::end(fusion::segments(*stack.car.first)))
|
||||
, recurse::call(stack.cdr)));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Stack>
|
||||
struct make_segment_sequence_front<Stack, 2>
|
||||
{
|
||||
// assert(end(front(car(stack_begin))) == end(car(cdr(stack_begin))));
|
||||
BOOST_MPL_ASSERT((
|
||||
result_of::equal_to<
|
||||
typename result_of::end<
|
||||
typename remove_reference<
|
||||
typename add_const<
|
||||
typename result_of::deref<
|
||||
typename Stack::car_type::begin_type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
, typename Stack::cdr_type::car_type::end_type
|
||||
>));
|
||||
|
||||
typedef
|
||||
iterator_range<
|
||||
typename Stack::cdr_type::car_type::begin_type
|
||||
, typename result_of::end<
|
||||
typename remove_reference<
|
||||
typename add_const<
|
||||
typename result_of::deref<
|
||||
typename Stack::car_type::begin_type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Stack const& stack)
|
||||
{
|
||||
// return iterator_range(begin(car(cdr(stack_begin))), end(front(car(stack_begin))));
|
||||
return type(stack.cdr.car.first, fusion::end(*stack.car.first));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Stack>
|
||||
struct make_segment_sequence_front<Stack, 1>
|
||||
{
|
||||
typedef typename Stack::cdr_type type; // nil_
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Stack const &stack)
|
||||
{
|
||||
return stack.cdr;
|
||||
}
|
||||
};
|
||||
|
||||
//auto make_segment_sequence_back(stack_end)
|
||||
//{
|
||||
// switch (size(stack_end))
|
||||
// {
|
||||
// case 1:
|
||||
// return nil_;
|
||||
// case 2:
|
||||
// // car(cdr(stack_back)) is a range over values.
|
||||
// assert(end(front(car(stack_end))) == end(car(cdr(stack_end))));
|
||||
// return iterator_range(begin(front(car(stack_end))), begin(car(cdr(stack_end))));
|
||||
// default:
|
||||
// // car(cdr(stack_begin)) is a range over segments. We replace the
|
||||
// // back with a view that is restricted.
|
||||
// assert(end(segments(front(car(stack_end)))) == end(car(cdr(stack_end))));
|
||||
// return segment_sequence(
|
||||
// push_back(
|
||||
// iterator_range(begin(segments(front(car(stack_end)))), begin(car(cdr(stack_end)))),
|
||||
// make_segment_sequence_back(cdr(stack_end))));
|
||||
// }
|
||||
//}
|
||||
|
||||
template <typename Stack, std::size_t Size = Stack::size::value>
|
||||
struct make_segment_sequence_back
|
||||
{
|
||||
// assert(end(segments(front(car(stack_begin)))) == end(car(cdr(stack_begin))));
|
||||
BOOST_MPL_ASSERT((
|
||||
result_of::equal_to<
|
||||
typename result_of::end<
|
||||
typename remove_reference<
|
||||
typename add_const<
|
||||
typename result_of::segments<
|
||||
typename remove_reference<
|
||||
typename add_const<
|
||||
typename result_of::deref<
|
||||
typename Stack::car_type::begin_type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
, typename Stack::cdr_type::car_type::end_type
|
||||
>));
|
||||
|
||||
typedef
|
||||
iterator_range<
|
||||
typename result_of::begin<
|
||||
typename remove_reference<
|
||||
typename add_const<
|
||||
typename result_of::segments<
|
||||
typename remove_reference<
|
||||
typename add_const<
|
||||
typename result_of::deref<
|
||||
typename Stack::car_type::begin_type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
, typename Stack::cdr_type::car_type::begin_type
|
||||
>
|
||||
rest_type;
|
||||
|
||||
typedef
|
||||
make_segment_sequence_back<typename Stack::cdr_type>
|
||||
recurse;
|
||||
|
||||
typedef
|
||||
segment_sequence<
|
||||
typename result_of::push_back<
|
||||
rest_type const
|
||||
, typename recurse::type
|
||||
>::type
|
||||
>
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Stack const& stack)
|
||||
{
|
||||
// return segment_sequence(
|
||||
// push_back(
|
||||
// iterator_range(begin(segments(front(car(stack_end)))), begin(car(cdr(stack_end)))),
|
||||
// make_segment_sequence_back(cdr(stack_end))));
|
||||
return type(
|
||||
fusion::push_back(
|
||||
rest_type(fusion::begin(fusion::segments(*stack.car.first)), stack.cdr.car.first)
|
||||
, recurse::call(stack.cdr)));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Stack>
|
||||
struct make_segment_sequence_back<Stack, 2>
|
||||
{
|
||||
// assert(end(front(car(stack_end))) == end(car(cdr(stack_end))));
|
||||
BOOST_MPL_ASSERT((
|
||||
result_of::equal_to<
|
||||
typename result_of::end<
|
||||
typename remove_reference<
|
||||
typename add_const<
|
||||
typename result_of::deref<
|
||||
typename Stack::car_type::begin_type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
, typename Stack::cdr_type::car_type::end_type
|
||||
>));
|
||||
|
||||
typedef
|
||||
iterator_range<
|
||||
typename result_of::begin<
|
||||
typename remove_reference<
|
||||
typename add_const<
|
||||
typename result_of::deref<
|
||||
typename Stack::car_type::begin_type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
, typename Stack::cdr_type::car_type::begin_type
|
||||
>
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Stack const& stack)
|
||||
{
|
||||
// return iterator_range(begin(front(car(stack_end))), begin(car(cdr(stack_end))));
|
||||
return type(fusion::begin(*stack.car.first), stack.cdr.car.first);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Stack>
|
||||
struct make_segment_sequence_back<Stack, 1>
|
||||
{
|
||||
typedef typename Stack::cdr_type type; // nil_
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Stack const& stack)
|
||||
{
|
||||
return stack.cdr;
|
||||
}
|
||||
};
|
||||
|
||||
//auto make_segmented_range_reduce(stack_begin, stack_end)
|
||||
//{
|
||||
// if (size(stack_begin) == 1 && size(stack_end) == 1)
|
||||
// {
|
||||
// return segment_sequence(
|
||||
// single_view(
|
||||
// iterator_range(begin(car(stack_begin)), begin(car(stack_end)))));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // We are in the case where both begin_stack and/or end_stack have
|
||||
// // more than one element. Throw away any part of the tree where
|
||||
// // begin and end refer to the same segment.
|
||||
// if (begin(car(stack_begin)) == begin(car(stack_end)))
|
||||
// {
|
||||
// return make_segmented_range_reduce(cdr(stack_begin), cdr(stack_end));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // We are in the case where begin_stack and end_stack (a) have
|
||||
// // more than one element each, and (b) they point to different
|
||||
// // segments. We must construct a segmented sequence.
|
||||
// return segment_sequence(
|
||||
// push_back(
|
||||
// push_front(
|
||||
// iterator_range(
|
||||
// fusion::next(begin(car(stack_begin))),
|
||||
// begin(car(stack_end))), // a range of (possibly segmented) ranges.
|
||||
// make_segment_sequence_front(stack_begin)), // should be a (possibly segmented) range.
|
||||
// make_segment_sequence_back(stack_end))); // should be a (possibly segmented) range.
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
template <
|
||||
typename StackBegin
|
||||
, typename StackEnd
|
||||
, int StackBeginSize = StackBegin::size::value
|
||||
, int StackEndSize = StackEnd::size::value>
|
||||
struct make_segmented_range_reduce;
|
||||
|
||||
template <
|
||||
typename StackBegin
|
||||
, typename StackEnd
|
||||
, bool SameSegment
|
||||
#if !(BOOST_WORKAROUND(BOOST_GCC, >= 40000) && BOOST_WORKAROUND(BOOST_GCC, < 40200))
|
||||
= result_of::equal_to<
|
||||
typename StackBegin::car_type::begin_type
|
||||
, typename StackEnd::car_type::begin_type
|
||||
>::type::value
|
||||
#endif
|
||||
>
|
||||
struct make_segmented_range_reduce2
|
||||
{
|
||||
typedef
|
||||
iterator_range<
|
||||
typename result_of::next<
|
||||
typename StackBegin::car_type::begin_type
|
||||
>::type
|
||||
, typename StackEnd::car_type::begin_type
|
||||
>
|
||||
rest_type;
|
||||
|
||||
typedef
|
||||
segment_sequence<
|
||||
typename result_of::push_back<
|
||||
typename result_of::push_front<
|
||||
rest_type const
|
||||
, typename make_segment_sequence_front<StackBegin>::type
|
||||
>::type const
|
||||
, typename make_segment_sequence_back<StackEnd>::type
|
||||
>::type
|
||||
>
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(StackBegin stack_begin, StackEnd stack_end)
|
||||
{
|
||||
//return segment_sequence(
|
||||
// push_back(
|
||||
// push_front(
|
||||
// iterator_range(
|
||||
// fusion::next(begin(car(stack_begin))),
|
||||
// begin(car(stack_end))), // a range of (possibly segmented) ranges.
|
||||
// make_segment_sequence_front(stack_begin)), // should be a (possibly segmented) range.
|
||||
// make_segment_sequence_back(stack_end))); // should be a (possibly segmented) range.
|
||||
return type(
|
||||
fusion::push_back(
|
||||
fusion::push_front(
|
||||
rest_type(fusion::next(stack_begin.car.first), stack_end.car.first)
|
||||
, make_segment_sequence_front<StackBegin>::call(stack_begin))
|
||||
, make_segment_sequence_back<StackEnd>::call(stack_end)));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename StackBegin, typename StackEnd>
|
||||
struct make_segmented_range_reduce2<StackBegin, StackEnd, true>
|
||||
{
|
||||
typedef
|
||||
make_segmented_range_reduce<
|
||||
typename StackBegin::cdr_type
|
||||
, typename StackEnd::cdr_type
|
||||
>
|
||||
impl;
|
||||
|
||||
typedef
|
||||
typename impl::type
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(StackBegin stack_begin, StackEnd stack_end)
|
||||
{
|
||||
return impl::call(stack_begin.cdr, stack_end.cdr);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename StackBegin, typename StackEnd, int StackBeginSize, int StackEndSize>
|
||||
struct make_segmented_range_reduce
|
||||
: make_segmented_range_reduce2<StackBegin, StackEnd
|
||||
#if BOOST_WORKAROUND(BOOST_GCC, >= 40000) && BOOST_WORKAROUND(BOOST_GCC, < 40200)
|
||||
, result_of::equal_to<
|
||||
typename StackBegin::car_type::begin_type
|
||||
, typename StackEnd::car_type::begin_type
|
||||
>::type::value
|
||||
#endif
|
||||
>
|
||||
{};
|
||||
|
||||
template <typename StackBegin, typename StackEnd>
|
||||
struct make_segmented_range_reduce<StackBegin, StackEnd, 1, 1>
|
||||
{
|
||||
typedef
|
||||
iterator_range<
|
||||
typename StackBegin::car_type::begin_type
|
||||
, typename StackEnd::car_type::begin_type
|
||||
>
|
||||
range_type;
|
||||
|
||||
typedef
|
||||
single_view<range_type>
|
||||
segment_type;
|
||||
|
||||
typedef
|
||||
segment_sequence<segment_type>
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(StackBegin stack_begin, StackEnd stack_end)
|
||||
{
|
||||
//return segment_sequence(
|
||||
// single_view(
|
||||
// iterator_range(begin(car(stack_begin)), begin(car(stack_end)))));
|
||||
return type(segment_type(range_type(stack_begin.car.first, stack_end.car.first)));
|
||||
}
|
||||
};
|
||||
|
||||
//auto make_segmented_range(begin, end)
|
||||
//{
|
||||
// return make_segmented_range_reduce(reverse(begin.context), reverse(end.context));
|
||||
//}
|
||||
|
||||
template <typename Begin, typename End>
|
||||
struct make_segmented_range
|
||||
{
|
||||
typedef reverse_cons<typename Begin::context_type> reverse_begin_cons;
|
||||
typedef reverse_cons<typename End::context_type> reverse_end_cons;
|
||||
|
||||
typedef
|
||||
make_segmented_range_reduce<
|
||||
typename reverse_begin_cons::type
|
||||
, typename reverse_end_cons::type
|
||||
>
|
||||
impl;
|
||||
|
||||
typedef typename impl::type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Begin const& begin, End const& end)
|
||||
{
|
||||
return impl::call(
|
||||
reverse_begin_cons::call(begin.context)
|
||||
, reverse_end_cons::call(end.context));
|
||||
}
|
||||
};
|
||||
|
||||
}}}
|
||||
|
||||
#endif
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_ITERATOR_RANGE_SEGMENTS_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_ITERATOR_RANGE_SEGMENTS_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/segments.hpp>
|
||||
#include <boost/fusion/support/is_segmented.hpp>
|
||||
#include <boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct iterator_range_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct segments_impl;
|
||||
|
||||
template <>
|
||||
struct segments_impl<iterator_range_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef
|
||||
detail::make_segmented_range<
|
||||
typename Sequence::begin_type
|
||||
, typename Sequence::end_type
|
||||
>
|
||||
impl;
|
||||
|
||||
BOOST_MPL_ASSERT((traits::is_segmented<typename impl::type>));
|
||||
|
||||
typedef
|
||||
typename result_of::segments<typename impl::type>::type
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Sequence & seq)
|
||||
{
|
||||
return fusion::segments(impl::call(seq.first, seq.last));
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_ITERATOR_RANGE_SIZE_IMPL_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_ITERATOR_RANGE_SIZE_IMPL_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/distance.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct iterator_range_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct size_impl;
|
||||
|
||||
template <>
|
||||
struct size_impl<iterator_range_tag>
|
||||
{
|
||||
template <typename Seq>
|
||||
struct apply
|
||||
: result_of::distance<
|
||||
typename Seq::begin_type,
|
||||
typename Seq::end_type
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2007 Tobias Schwinger
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_ITERATOR_RANGE_VALUE_AT_IMPL_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_ITERATOR_RANGE_VALUE_AT_IMPL_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/advance.hpp>
|
||||
#include <boost/fusion/iterator/value_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct iterator_range_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct value_at_impl;
|
||||
|
||||
template <>
|
||||
struct value_at_impl<iterator_range_tag>
|
||||
{
|
||||
template <typename Seq, typename N>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Seq::begin_type begin_type;
|
||||
typedef typename result_of::advance<begin_type,N>::type pos;
|
||||
typedef typename result_of::value_of<pos>::type type;
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_ITERATOR_RANGE_05062005_1224)
|
||||
#define FUSION_ITERATOR_RANGE_05062005_1224
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/fusion/support/sequence_base.hpp>
|
||||
#include <boost/fusion/support/category_of.hpp>
|
||||
#include <boost/fusion/iterator/distance.hpp>
|
||||
#include <boost/fusion/iterator/mpl/convert_iterator.hpp>
|
||||
#include <boost/fusion/view/iterator_range/detail/begin_impl.hpp>
|
||||
#include <boost/fusion/view/iterator_range/detail/end_impl.hpp>
|
||||
#include <boost/fusion/view/iterator_range/detail/at_impl.hpp>
|
||||
#include <boost/fusion/view/iterator_range/detail/size_impl.hpp>
|
||||
#include <boost/fusion/view/iterator_range/detail/value_at_impl.hpp>
|
||||
#include <boost/fusion/view/iterator_range/detail/is_segmented_impl.hpp>
|
||||
#include <boost/fusion/view/iterator_range/detail/segments_impl.hpp>
|
||||
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined (BOOST_MSVC)
|
||||
# pragma warning(push)
|
||||
# pragma warning (disable: 4512) // assignment operator could not be generated.
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct iterator_range_tag;
|
||||
struct fusion_sequence_tag;
|
||||
|
||||
template <typename First, typename Last>
|
||||
struct iterator_range : sequence_base<iterator_range<First, Last> >
|
||||
{
|
||||
typedef typename convert_iterator<First>::type begin_type;
|
||||
typedef typename convert_iterator<Last>::type end_type;
|
||||
typedef iterator_range_tag fusion_tag;
|
||||
typedef fusion_sequence_tag tag; // this gets picked up by MPL
|
||||
typedef mpl::true_ is_view;
|
||||
|
||||
typedef typename traits::category_of<begin_type>::type category;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
iterator_range(First const& in_first, Last const& in_last)
|
||||
: first(convert_iterator<First>::call(in_first))
|
||||
, last(convert_iterator<Last>::call(in_last)) {}
|
||||
|
||||
begin_type first;
|
||||
end_type last;
|
||||
};
|
||||
}}
|
||||
|
||||
#if defined (BOOST_MSVC)
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_SEQUENCE_VIEW_JOINT_VIEW_10022005_0610)
|
||||
#define FUSION_SEQUENCE_VIEW_JOINT_VIEW_10022005_0610
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/view/joint_view/joint_view.hpp>
|
||||
#include <boost/fusion/view/joint_view/joint_view_iterator.hpp>
|
||||
|
||||
#endif
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_BEGIN_IMPL_07162005_0115)
|
||||
#define FUSION_BEGIN_IMPL_07162005_0115
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct joint_view_tag;
|
||||
|
||||
template <typename Category, typename First, typename Last, typename Concat>
|
||||
struct joint_view_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct begin_impl;
|
||||
|
||||
template <>
|
||||
struct begin_impl<joint_view_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Sequence::first_type first_type;
|
||||
typedef typename Sequence::last_type last_type;
|
||||
typedef typename Sequence::concat_type concat_type;
|
||||
typedef typename Sequence::category category;
|
||||
typedef result_of::equal_to<first_type, last_type> equal_to;
|
||||
|
||||
typedef typename
|
||||
mpl::if_<
|
||||
equal_to
|
||||
, concat_type
|
||||
, joint_view_iterator<category, first_type, last_type, concat_type>
|
||||
>::type
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence& s, mpl::true_)
|
||||
{
|
||||
return s.concat();
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence& s, mpl::false_)
|
||||
{
|
||||
return type(s.first(), s.concat());
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence& s)
|
||||
{
|
||||
return call(s, equal_to());
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_DEREF_DATA_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_DEREF_DATA_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/deref_data.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct deref_data_impl;
|
||||
|
||||
template <>
|
||||
struct deref_data_impl<joint_view_iterator_tag>
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
{
|
||||
typedef typename
|
||||
result_of::deref_data<typename It::first_type>::type
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(It const& it)
|
||||
{
|
||||
return fusion::deref_data(it.first);
|
||||
}
|
||||
};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_DEREF_IMPL_07162005_0137)
|
||||
#define FUSION_DEREF_IMPL_07162005_0137
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/detail/adapt_deref_traits.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct joint_view_iterator_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct deref_impl;
|
||||
|
||||
template <>
|
||||
struct deref_impl<joint_view_iterator_tag>
|
||||
: detail::adapt_deref_traits {};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_END_IMPL_07162005_0128)
|
||||
#define FUSION_END_IMPL_07162005_0128
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct joint_view_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct end_impl;
|
||||
|
||||
template <>
|
||||
struct end_impl<joint_view_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Sequence::concat_last_type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence& s)
|
||||
{
|
||||
return s.concat_last();
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_KEY_OF_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_KEY_OF_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/key_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct key_of_impl;
|
||||
|
||||
template <>
|
||||
struct key_of_impl<joint_view_iterator_tag>
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
: result_of::key_of<typename It::first_type>
|
||||
{};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,75 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_NEXT_IMPL_07162005_0136)
|
||||
#define FUSION_NEXT_IMPL_07162005_0136
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/next.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct joint_view_iterator_tag;
|
||||
|
||||
template <typename Category, typename First, typename Last, typename Concat>
|
||||
struct joint_view_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct next_impl;
|
||||
|
||||
template <>
|
||||
struct next_impl<joint_view_iterator_tag>
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Iterator::first_type first_type;
|
||||
typedef typename Iterator::last_type last_type;
|
||||
typedef typename Iterator::concat_type concat_type;
|
||||
typedef typename Iterator::category category;
|
||||
typedef typename result_of::next<first_type>::type next_type;
|
||||
typedef result_of::equal_to<next_type, last_type> equal_to;
|
||||
|
||||
typedef typename
|
||||
mpl::if_<
|
||||
equal_to
|
||||
, concat_type
|
||||
, joint_view_iterator<category, next_type, last_type, concat_type>
|
||||
>::type
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i, mpl::true_)
|
||||
{
|
||||
return i.concat;
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i, mpl::false_)
|
||||
{
|
||||
return type(fusion::next(i.first), i.concat);
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return call(i, equal_to());
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/value_of_data.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct value_of_data_impl;
|
||||
|
||||
template <>
|
||||
struct value_of_data_impl<joint_view_iterator_tag>
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
: result_of::value_of_data<typename It::first_type>
|
||||
{};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_VALUE_IMPL_07162005_0132)
|
||||
#define FUSION_VALUE_IMPL_07162005_0132
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/detail/adapt_value_traits.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct joint_view_iterator_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct value_of_impl;
|
||||
|
||||
template <>
|
||||
struct value_of_impl<joint_view_iterator_tag>
|
||||
: detail::adapt_value_traits {};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_JOINT_VIEW_07162005_0140)
|
||||
#define FUSION_JOINT_VIEW_07162005_0140
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/view/joint_view/joint_view_fwd.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/view/joint_view/joint_view_iterator.hpp>
|
||||
#include <boost/fusion/view/joint_view/detail/begin_impl.hpp>
|
||||
#include <boost/fusion/view/joint_view/detail/end_impl.hpp>
|
||||
#include <boost/fusion/support/sequence_base.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/plus.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/inherit.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct joint_view_tag;
|
||||
struct forward_traversal_tag;
|
||||
struct fusion_sequence_tag;
|
||||
|
||||
template <typename Sequence1, typename Sequence2>
|
||||
struct joint_view : sequence_base<joint_view<Sequence1, Sequence2> >
|
||||
{
|
||||
typedef joint_view_tag fusion_tag;
|
||||
typedef fusion_sequence_tag tag; // this gets picked up by MPL
|
||||
typedef typename
|
||||
mpl::eval_if<
|
||||
mpl::and_<
|
||||
traits::is_associative<Sequence1>
|
||||
, traits::is_associative<Sequence2>
|
||||
>
|
||||
, mpl::inherit2<forward_traversal_tag,associative_tag>
|
||||
, mpl::identity<forward_traversal_tag>
|
||||
>::type
|
||||
category;
|
||||
typedef mpl::true_ is_view;
|
||||
|
||||
typedef typename result_of::begin<Sequence1>::type first_type;
|
||||
typedef typename result_of::end<Sequence1>::type last_type;
|
||||
typedef typename result_of::begin<Sequence2>::type concat_type;
|
||||
typedef typename result_of::end<Sequence2>::type concat_last_type;
|
||||
typedef typename mpl::int_<
|
||||
result_of::size<Sequence1>::value + result_of::size<Sequence2>::value>
|
||||
size;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
joint_view(Sequence1& in_seq1, Sequence2& in_seq2)
|
||||
: seq1(in_seq1)
|
||||
, seq2(in_seq2)
|
||||
{}
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
first_type first() const { return fusion::begin(seq1); }
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
concat_type concat() const { return fusion::begin(seq2); }
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
concat_last_type concat_last() const { return fusion::end(seq2); }
|
||||
|
||||
private:
|
||||
// silence MSVC warning C4512: assignment operator could not be generated
|
||||
joint_view& operator= (joint_view const&);
|
||||
|
||||
typename mpl::if_<traits::is_view<Sequence1>, Sequence1, Sequence1&>::type seq1;
|
||||
typename mpl::if_<traits::is_view<Sequence2>, Sequence2, Sequence2&>::type seq2;
|
||||
};
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_JOINT_VIEW_FWD_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_JOINT_VIEW_FWD_HPP_INCLUDED
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct joint_view_tag;
|
||||
|
||||
template <typename Sequence1, typename Sequence2>
|
||||
struct joint_view;
|
||||
}}
|
||||
|
||||
#endif
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_JOINT_VIEW_ITERATOR_07162005_0140)
|
||||
#define FUSION_JOINT_VIEW_ITERATOR_07162005_0140
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/support/iterator_base.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/iterator/mpl/convert_iterator.hpp>
|
||||
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
|
||||
#include <boost/fusion/view/joint_view/detail/deref_impl.hpp>
|
||||
#include <boost/fusion/view/joint_view/detail/next_impl.hpp>
|
||||
#include <boost/fusion/view/joint_view/detail/value_of_impl.hpp>
|
||||
#include <boost/fusion/view/joint_view/detail/deref_data_impl.hpp>
|
||||
#include <boost/fusion/view/joint_view/detail/value_of_data_impl.hpp>
|
||||
#include <boost/fusion/view/joint_view/detail/key_of_impl.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct joint_view_iterator_tag;
|
||||
struct forward_traversal_tag;
|
||||
|
||||
template <typename Category, typename First, typename Last, typename Concat>
|
||||
struct joint_view_iterator
|
||||
: iterator_base<joint_view_iterator<Category, First, Last, Concat> >
|
||||
{
|
||||
typedef convert_iterator<First> first_converter;
|
||||
typedef convert_iterator<Last> last_converter;
|
||||
typedef convert_iterator<Concat> concat_converter;
|
||||
|
||||
typedef typename first_converter::type first_type;
|
||||
typedef typename last_converter::type last_type;
|
||||
typedef typename concat_converter::type concat_type;
|
||||
|
||||
typedef joint_view_iterator_tag fusion_tag;
|
||||
typedef Category category;
|
||||
BOOST_STATIC_ASSERT((!result_of::equal_to<first_type, last_type>::value));
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
joint_view_iterator(First const& in_first, Concat const& in_concat)
|
||||
: first(first_converter::call(in_first))
|
||||
, concat(concat_converter::call(in_concat))
|
||||
{}
|
||||
|
||||
first_type first;
|
||||
concat_type concat;
|
||||
|
||||
private:
|
||||
// silence MSVC warning C4512: assignment operator could not be generated
|
||||
joint_view_iterator& operator= (joint_view_iterator const&);
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Category, typename First, typename Last, typename Concat>
|
||||
struct iterator_traits< ::boost::fusion::joint_view_iterator<Category, First, Last, Concat> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2006 Dan Marsden
|
||||
Copyright (c) 2009 Hartmut Kaiser
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_NVIEW_SEP_23_2009_1107PM)
|
||||
#define FUSION_NVIEW_SEP_23_2009_1107PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/view/nview/nview.hpp>
|
||||
#include <boost/fusion/view/nview/nview_iterator.hpp>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,50 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Hartmut Kaiser
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_NVIEW_ADVANCE_IMPL_SEP_24_2009_0212PM)
|
||||
#define BOOST_FUSION_NVIEW_ADVANCE_IMPL_SEP_24_2009_0212PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/advance.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct nview_iterator_tag;
|
||||
|
||||
template <typename Sequence, typename Pos>
|
||||
struct nview_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct advance_impl;
|
||||
|
||||
template<>
|
||||
struct advance_impl<nview_iterator_tag>
|
||||
{
|
||||
template<typename Iterator, typename Dist>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Iterator::first_type iterator_type;
|
||||
typedef typename Iterator::sequence_type sequence_type;
|
||||
|
||||
typedef nview_iterator<sequence_type,
|
||||
typename result_of::advance<iterator_type, Dist>::type> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type(i.seq);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,48 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Hartmut Kaiser
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_NVIEW_AT_IMPL_SEP_24_2009_0225PM)
|
||||
#define BOOST_FUSION_NVIEW_AT_IMPL_SEP_24_2009_0225PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/at.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/value_at.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct nview_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct at_impl;
|
||||
|
||||
template<>
|
||||
struct at_impl<nview_tag>
|
||||
{
|
||||
template<typename Sequence, typename N>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Sequence::sequence_type sequence_type;
|
||||
typedef typename Sequence::index_type index_type;
|
||||
|
||||
typedef typename result_of::value_at<index_type, N>::type index;
|
||||
typedef typename result_of::at<sequence_type, index>::type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence& seq)
|
||||
{
|
||||
return fusion::at<index>(seq.seq);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,49 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Hartmut Kaiser
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_NVIEW_BEGIN_IMPL_SEP_23_2009_1036PM)
|
||||
#define BOOST_FUSION_NVIEW_BEGIN_IMPL_SEP_23_2009_1036PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct nview_tag;
|
||||
|
||||
template <typename Sequence, typename Pos>
|
||||
struct nview_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct begin_impl;
|
||||
|
||||
template<>
|
||||
struct begin_impl<nview_tag>
|
||||
{
|
||||
template<typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Sequence::index_type index_type;
|
||||
|
||||
typedef nview_iterator<Sequence,
|
||||
typename result_of::begin<index_type>::type> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Sequence& s)
|
||||
{
|
||||
return type(s);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Hartmut Kaiser
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_PP_IS_ITERATING
|
||||
|
||||
#if !defined(BOOST_FUSION_NVIEW_IMPL_SEP_23_2009_1017PM)
|
||||
#define BOOST_FUSION_NVIEW_IMPL_SEP_23_2009_1017PM
|
||||
|
||||
#include <climits>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/repeat.hpp>
|
||||
#include <boost/preprocessor/iterate.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
#include <boost/mpl/vector_c.hpp>
|
||||
#include <boost/fusion/adapted/mpl.hpp>
|
||||
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3, (1, FUSION_MAX_VECTOR_SIZE, \
|
||||
"boost/fusion/view/nview/detail/cpp03/nview_impl.hpp")) \
|
||||
/**/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
namespace boost { namespace fusion { namespace result_of
|
||||
{
|
||||
template <typename Sequence
|
||||
, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(FUSION_MAX_VECTOR_SIZE, int I, INT_MAX)>
|
||||
struct as_nview
|
||||
{
|
||||
typedef mpl::vector_c<
|
||||
int, BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, I)
|
||||
> index_type;
|
||||
typedef nview<Sequence, index_type> type;
|
||||
};
|
||||
}}}
|
||||
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Preprocessor vertical repetition code
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#else // defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
#define N BOOST_PP_ITERATION()
|
||||
|
||||
#if N < FUSION_MAX_VECTOR_SIZE
|
||||
namespace boost { namespace fusion { namespace result_of
|
||||
{
|
||||
template <typename Sequence, BOOST_PP_ENUM_PARAMS(N, int I)>
|
||||
struct as_nview<Sequence, BOOST_PP_ENUM_PARAMS(N, I)>
|
||||
{
|
||||
typedef mpl::vector_c<int, BOOST_PP_ENUM_PARAMS(N, I)> index_type;
|
||||
typedef nview<Sequence, index_type> type;
|
||||
};
|
||||
}}}
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
template<BOOST_PP_ENUM_PARAMS(N, int I), typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline nview<Sequence, mpl::vector_c<int, BOOST_PP_ENUM_PARAMS(N, I)> >
|
||||
as_nview(Sequence& s)
|
||||
{
|
||||
typedef mpl::vector_c<int, BOOST_PP_ENUM_PARAMS(N, I)> index_type;
|
||||
return nview<Sequence, index_type>(s);
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#undef N
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,50 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Hartmut Kaiser
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_NVIEW_DEREF_IMPL_SEP_24_2009_0818AM)
|
||||
#define BOOST_FUSION_NVIEW_DEREF_IMPL_SEP_24_2009_0818AM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/value_of.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/at.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct nview_iterator_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct deref_impl;
|
||||
|
||||
template<>
|
||||
struct deref_impl<nview_iterator_tag>
|
||||
{
|
||||
template<typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Iterator::first_type first_type;
|
||||
typedef typename Iterator::sequence_type sequence_type;
|
||||
|
||||
typedef typename result_of::value_of<first_type>::type index;
|
||||
typedef typename result_of::at<
|
||||
typename sequence_type::sequence_type, index>::type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Iterator const& i)
|
||||
{
|
||||
return at<index>(i.seq.seq);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Hartmut Kaiser
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_NVIEW_DISTANCE_IMPL_SEP_23_2009_0328PM)
|
||||
#define BOOST_FUSION_NVIEW_DISTANCE_IMPL_SEP_23_2009_0328PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/distance.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct nview_iterator_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct distance_impl;
|
||||
|
||||
template<>
|
||||
struct distance_impl<nview_iterator_tag>
|
||||
{
|
||||
template<typename First, typename Last>
|
||||
struct apply
|
||||
: result_of::distance<typename First::first_type, typename Last::first_type>
|
||||
{
|
||||
typedef typename result_of::distance<
|
||||
typename First::first_type, typename Last::first_type
|
||||
>::type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(First const& /*first*/, Last const& /*last*/)
|
||||
{
|
||||
return type();
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,51 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Hartmut Kaiser
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_NVIEW_END_IMPL_SEP_24_2009_0140PM)
|
||||
#define BOOST_FUSION_NVIEW_END_IMPL_SEP_24_2009_0140PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct nview_tag;
|
||||
|
||||
template <typename Sequence, typename Pos>
|
||||
struct nview_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct end_impl;
|
||||
|
||||
// Unary Version
|
||||
template <>
|
||||
struct end_impl<nview_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Sequence::index_type index_type;
|
||||
|
||||
typedef nview_iterator<Sequence,
|
||||
typename result_of::end<index_type>::type> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Sequence& s)
|
||||
{
|
||||
return type(s);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Hartmut Kaiser
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_NVIEW_ITERATOR_SEP_24_2009_0329PM)
|
||||
#define BOOST_FUSION_NVIEW_ITERATOR_SEP_24_2009_0329PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct nview_iterator_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct equal_to_impl;
|
||||
|
||||
template<>
|
||||
struct equal_to_impl<nview_iterator_tag>
|
||||
{
|
||||
template<typename It1, typename It2>
|
||||
struct apply
|
||||
: result_of::equal_to<typename It1::first_type, typename It2::first_type>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,50 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Hartmut Kaiser
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_NVIEW_NEXT_IMPL_SEP_24_2009_0116PM)
|
||||
#define BOOST_FUSION_NVIEW_NEXT_IMPL_SEP_24_2009_0116PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/next.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct nview_iterator_tag;
|
||||
|
||||
template <typename Sequence, typename Pos>
|
||||
struct nview_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct next_impl;
|
||||
|
||||
template <>
|
||||
struct next_impl<nview_iterator_tag>
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Iterator::first_type first_type;
|
||||
typedef typename Iterator::sequence_type sequence_type;
|
||||
|
||||
typedef nview_iterator<sequence_type,
|
||||
typename result_of::next<first_type>::type> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type(i.seq);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,50 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2014 Kohei Takahashi
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#ifndef BOOST_FUSION_NVIEW_IMPL_17122014_1948
|
||||
#define BOOST_FUSION_NVIEW_IMPL_17122014_1948
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/container/vector/detail/config.hpp>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Without variadics, we will use the PP version
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
|
||||
# include <boost/fusion/view/nview/detail/cpp03/nview_impl.hpp>
|
||||
#else
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// C++11 interface
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#include <boost/fusion/container/vector.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence, int ...I>
|
||||
struct as_nview
|
||||
{
|
||||
typedef vector<mpl::int_<I>...> index_type;
|
||||
typedef nview<Sequence, index_type> type;
|
||||
};
|
||||
}
|
||||
|
||||
template <int ...I, typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline nview<Sequence, vector<mpl::int_<I>...> >
|
||||
as_nview(Sequence& s)
|
||||
{
|
||||
typedef vector<mpl::int_<I>...> index_type;
|
||||
return nview<Sequence, index_type>(s);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Hartmut Kaiser
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_NVIEW_PRIOR_IMPL_SEP_24_2009_0142PM)
|
||||
#define BOOST_FUSION_NVIEW_PRIOR_IMPL_SEP_24_2009_0142PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/prior.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct nview_iterator_tag;
|
||||
|
||||
template <typename Sequence, typename Pos>
|
||||
struct nview_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct prior_impl;
|
||||
|
||||
template <>
|
||||
struct prior_impl<nview_iterator_tag>
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Iterator::first_type first_type;
|
||||
typedef typename Iterator::sequence_type sequence_type;
|
||||
|
||||
typedef nview_iterator<sequence_type,
|
||||
typename result_of::prior<first_type>::type> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type(i.seq);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,39 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_NVIEW_SIZE_IMPL_OCT_06_2009_0525PM)
|
||||
#define FUSION_NVIEW_SIZE_IMPL_OCT_06_2009_0525PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/distance.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct nview_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct size_impl;
|
||||
|
||||
template <>
|
||||
struct size_impl<nview_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
: result_of::distance<
|
||||
typename result_of::begin<Sequence>::type
|
||||
, typename result_of::end<Sequence>::type>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Hartmut Kaiser
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_NVIEW_VALUE_AT_IMPL_SEP_24_2009_0234PM)
|
||||
#define BOOST_FUSION_NVIEW_VALUE_AT_IMPL_SEP_24_2009_0234PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/value_at.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct nview_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct value_at_impl;
|
||||
|
||||
template<>
|
||||
struct value_at_impl<nview_tag>
|
||||
{
|
||||
template<typename Sequence, typename N>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Sequence::sequence_type sequence_type;
|
||||
typedef typename Sequence::index_type index_type;
|
||||
|
||||
typedef typename result_of::at<index_type, N>::type index;
|
||||
typedef typename result_of::at<sequence_type, index>::type type;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,45 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Hartmut Kaiser
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_VALUE_OF_PRIOR_IMPL_SEP_24_2009_0158PM)
|
||||
#define BOOST_FUSION_VALUE_OF_PRIOR_IMPL_SEP_24_2009_0158PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/deref.hpp>
|
||||
#include <boost/fusion/container/vector.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct nview_iterator_tag;
|
||||
|
||||
template <typename Sequence, typename Pos>
|
||||
struct nview_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct value_of_impl;
|
||||
|
||||
template <>
|
||||
struct value_of_impl<nview_iterator_tag>
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Iterator::first_type first_type;
|
||||
typedef typename Iterator::sequence_type sequence_type;
|
||||
|
||||
typedef typename result_of::deref<first_type>::type index;
|
||||
typedef typename result_of::at<
|
||||
typename sequence_type::sequence_type, index>::type type;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,122 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Hartmut Kaiser
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_NVIEW_SEP_23_2009_0948PM)
|
||||
#define BOOST_FUSION_NVIEW_SEP_23_2009_0948PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/fusion/support/sequence_base.hpp>
|
||||
#include <boost/fusion/container/vector.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/view/transform_view.hpp>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
struct addref
|
||||
{
|
||||
template<typename Sig>
|
||||
struct result;
|
||||
|
||||
template<typename U>
|
||||
struct result<addref(U)> : add_reference<U> {};
|
||||
|
||||
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <typename T>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
typename add_reference<T>::type
|
||||
operator()(T& x) const
|
||||
{
|
||||
return x;
|
||||
}
|
||||
#else
|
||||
template <typename T>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
typename result<addref(T)>::type
|
||||
operator()(T&& x) const
|
||||
{
|
||||
return x;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
struct addconstref
|
||||
{
|
||||
template<typename Sig>
|
||||
struct result;
|
||||
|
||||
template<typename U>
|
||||
struct result<addconstref(U)>
|
||||
: add_reference<typename add_const<U>::type>
|
||||
{};
|
||||
|
||||
template <typename T>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
typename add_reference<typename add_const<T>::type>::type
|
||||
operator()(T& x) const
|
||||
{
|
||||
return x;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
typename add_reference<typename add_const<T>::type>::type
|
||||
operator()(T const& x) const
|
||||
{
|
||||
return x;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
struct nview_tag;
|
||||
struct random_access_traversal_tag;
|
||||
struct fusion_sequence_tag;
|
||||
|
||||
template<typename Sequence, typename Indicies>
|
||||
struct nview
|
||||
: sequence_base<nview<Sequence, Indicies> >
|
||||
{
|
||||
typedef nview_tag fusion_tag;
|
||||
typedef fusion_sequence_tag tag; // this gets picked up by MPL
|
||||
typedef random_access_traversal_tag category;
|
||||
|
||||
typedef mpl::true_ is_view;
|
||||
typedef Indicies index_type;
|
||||
typedef typename result_of::size<Indicies>::type size;
|
||||
|
||||
typedef typename mpl::if_<
|
||||
is_const<Sequence>, detail::addconstref, detail::addref
|
||||
>::type transform_type;
|
||||
typedef transform_view<Sequence, transform_type> transform_view_type;
|
||||
typedef typename result_of::as_vector<transform_view_type>::type
|
||||
sequence_type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit nview(Sequence& val)
|
||||
: seq(sequence_type(transform_view_type(val, transform_type())))
|
||||
{}
|
||||
|
||||
sequence_type seq;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
// define the nview() generator functions
|
||||
#include <boost/fusion/view/nview/detail/nview_impl.hpp>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Hartmut Kaiser
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_NVIEW_ITERATOR_SEP_23_2009_0948PM)
|
||||
#define BOOST_FUSION_NVIEW_ITERATOR_SEP_23_2009_0948PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/support/iterator_base.hpp>
|
||||
#include <boost/fusion/support/category_of.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
|
||||
#include <boost/fusion/view/nview/detail/size_impl.hpp>
|
||||
#include <boost/fusion/view/nview/detail/begin_impl.hpp>
|
||||
#include <boost/fusion/view/nview/detail/end_impl.hpp>
|
||||
#include <boost/fusion/view/nview/detail/deref_impl.hpp>
|
||||
#include <boost/fusion/view/nview/detail/value_of_impl.hpp>
|
||||
#include <boost/fusion/view/nview/detail/next_impl.hpp>
|
||||
#include <boost/fusion/view/nview/detail/prior_impl.hpp>
|
||||
#include <boost/fusion/view/nview/detail/at_impl.hpp>
|
||||
#include <boost/fusion/view/nview/detail/value_at_impl.hpp>
|
||||
#include <boost/fusion/view/nview/detail/advance_impl.hpp>
|
||||
#include <boost/fusion/view/nview/detail/distance_impl.hpp>
|
||||
#include <boost/fusion/view/nview/detail/equal_to_impl.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct nview_iterator_tag;
|
||||
struct random_access_traversal_tag;
|
||||
|
||||
template<typename Sequence, typename Pos>
|
||||
struct nview_iterator
|
||||
: iterator_base<nview_iterator<Sequence, Pos> >
|
||||
{
|
||||
typedef nview_iterator_tag fusion_tag;
|
||||
typedef random_access_traversal_tag category;
|
||||
|
||||
typedef Sequence sequence_type;
|
||||
typedef Pos first_type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit nview_iterator(Sequence& in_seq)
|
||||
: seq(in_seq) {}
|
||||
|
||||
Sequence& seq;
|
||||
|
||||
private:
|
||||
// silence MSVC warning C4512: assignment operator could not be generated
|
||||
nview_iterator& operator= (nview_iterator const&);
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Sequence, typename Pos>
|
||||
struct iterator_traits< ::boost::fusion::nview_iterator<Sequence, Pos> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2007 Tobias Schwinger
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_REPETITIVE_VIEW_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_REPETITIVE_VIEW_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/view/repetitive_view/repetitive_view.hpp>
|
||||
#include <boost/fusion/view/repetitive_view/repetitive_view_iterator.hpp>
|
||||
|
||||
#endif
|
||||
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2007 Tobias Schwinger
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_REPETITIVE_VIEW_BEGIN_IMPL_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_REPETITIVE_VIEW_BEGIN_IMPL_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/view/repetitive_view/repetitive_view_fwd.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct repetitive_view_tag;
|
||||
|
||||
template <typename Sequence, typename Pos>
|
||||
struct repetitive_view_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct begin_impl;
|
||||
|
||||
template<>
|
||||
struct begin_impl<repetitive_view_tag>
|
||||
{
|
||||
template<typename View>
|
||||
struct apply
|
||||
{
|
||||
typedef typename View::sequence_type sequence_type;
|
||||
|
||||
typedef repetitive_view_iterator<sequence_type,
|
||||
typename result_of::begin<sequence_type>::type > type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(View const& v)
|
||||
{
|
||||
return type(v.seq);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2007 Tobias Schwinger
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_REPETITIVE_VIEW_DEREF_IMPL_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_REPETITIVE_VIEW_DEREF_IMPL_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/deref.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct repetitive_view_iterator_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct deref_impl;
|
||||
|
||||
template<>
|
||||
struct deref_impl<repetitive_view_iterator_tag>
|
||||
{
|
||||
template<typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef typename
|
||||
result_of::deref<typename Iterator::pos_type>::type
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Iterator const& i)
|
||||
{
|
||||
return *i.pos;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2007 Tobias Schwinger
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_REPETITIVE_VIEW_END_IMPL_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_REPETITIVE_VIEW_END_IMPL_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/view/repetitive_view/repetitive_view_fwd.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct repetitive_view_tag;
|
||||
|
||||
template <typename Sequence, typename Pos>
|
||||
struct repetitive_view_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct end_impl;
|
||||
|
||||
template<>
|
||||
struct end_impl<repetitive_view_tag>
|
||||
{
|
||||
template<typename View>
|
||||
struct apply
|
||||
{
|
||||
typedef typename View::sequence_type sequence_type;
|
||||
|
||||
typedef repetitive_view_iterator<sequence_type,
|
||||
typename result_of::end<sequence_type>::type > type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(View const& v)
|
||||
{
|
||||
return type(v.seq,end(v.seq));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2007 Tobias Schwinger
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_REPETITIVE_VIEW_NEXT_IMPL_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_REPETITIVE_VIEW_NEXT_IMPL_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/next.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct repetitive_view_iterator_tag;
|
||||
|
||||
template <typename Sequence, typename Pos>
|
||||
struct repetitive_view_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct next_impl;
|
||||
|
||||
template <>
|
||||
struct next_impl<repetitive_view_iterator_tag>
|
||||
{
|
||||
template<typename Iterator,
|
||||
bool Last = result_of::equal_to<typename Iterator::end_type,
|
||||
typename result_of::next<
|
||||
typename Iterator::pos_type
|
||||
>::type>::value >
|
||||
struct apply_nonempty // <Iterator,false>
|
||||
{
|
||||
// advanvce to next position
|
||||
|
||||
typedef repetitive_view_iterator<
|
||||
typename Iterator::sequence_type,
|
||||
typename result_of::next<typename Iterator::pos_type>::type
|
||||
>
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Iterator const& i)
|
||||
{
|
||||
return type(i.seq, next(i.pos));
|
||||
}
|
||||
};
|
||||
template <typename Iterator>
|
||||
struct apply_nonempty<Iterator,true>
|
||||
{
|
||||
// reset to beginning
|
||||
|
||||
typedef repetitive_view_iterator<
|
||||
typename Iterator::sequence_type,
|
||||
typename Iterator::first_type
|
||||
>
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Iterator const& i)
|
||||
{
|
||||
return type(i.seq);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Iterator,
|
||||
bool Empty = result_of::equal_to<typename Iterator::end_type,
|
||||
typename Iterator::pos_type>::value >
|
||||
struct apply // <Iterator,false>
|
||||
: apply_nonempty<Iterator>
|
||||
{ };
|
||||
|
||||
template <typename Iterator>
|
||||
struct apply<Iterator,true>
|
||||
{
|
||||
// eps^n = eps
|
||||
|
||||
typedef Iterator type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Iterator const& i)
|
||||
{
|
||||
return type(i);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2007 Tobias Schwinger
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_REPETITIVE_VIEW_VALUE_OF_IMPL_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_REPETITIVE_VIEW_VALUE_OF_IMPL_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/value_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct repetitive_view_iterator_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct value_of_impl;
|
||||
|
||||
template<>
|
||||
struct value_of_impl<repetitive_view_iterator_tag>
|
||||
{
|
||||
template<typename Iterator>
|
||||
struct apply
|
||||
: result_of::value_of<typename Iterator::pos_type>
|
||||
{ };
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2007 Tobias Schwinger
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_REPETITIVE_VIEW_REPETITIVE_VIEW_HPP_INCLUDED
|
||||
#define BOOST_FUSION_REPETITIVE_VIEW_REPETITIVE_VIEW_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/fusion/support/category_of.hpp>
|
||||
|
||||
#include <boost/fusion/view/repetitive_view/detail/begin_impl.hpp>
|
||||
#include <boost/fusion/view/repetitive_view/detail/end_impl.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct repetitive_view_tag;
|
||||
struct fusion_sequence_tag;
|
||||
|
||||
template<typename Sequence> struct repetitive_view
|
||||
: sequence_base< repetitive_view<Sequence> >
|
||||
{
|
||||
typedef repetitive_view_tag fusion_tag;
|
||||
typedef fusion_sequence_tag tag; // this gets picked up by MPL
|
||||
typedef mpl::true_ is_view;
|
||||
|
||||
typedef single_pass_traversal_tag category;
|
||||
|
||||
typedef typename boost::remove_reference<Sequence>::type sequence_type;
|
||||
typedef typename
|
||||
mpl::if_<traits::is_view<Sequence>, Sequence, sequence_type&>::type
|
||||
stored_seq_type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
repetitive_view(Sequence& in_seq)
|
||||
: seq(in_seq) {}
|
||||
|
||||
stored_seq_type seq;
|
||||
|
||||
private:
|
||||
// silence MSVC warning C4512: assignment operator could not be generated
|
||||
repetitive_view& operator= (repetitive_view const&);
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2007 Tobias Schwinger
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_REPETITIVE_VIEW_FWD_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_REPETITIVE_VIEW_FWD_HPP_INCLUDED
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct repetitive_view_tag;
|
||||
|
||||
template<typename Sequence> struct repetitive_view;
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2007 Tobias Schwinger
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_REPETITIVE_VIEW_ITERATOR_HPP_INCLUDED
|
||||
#define BOOST_FUSION_REPETITIVE_VIEW_ITERATOR_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/support/iterator_base.hpp>
|
||||
#include <boost/fusion/support/category_of.hpp>
|
||||
#include <boost/fusion/iterator/mpl/convert_iterator.hpp>
|
||||
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/view/repetitive_view/detail/deref_impl.hpp>
|
||||
#include <boost/fusion/view/repetitive_view/detail/next_impl.hpp>
|
||||
#include <boost/fusion/view/repetitive_view/detail/value_of_impl.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct repetitive_view_iterator_tag;
|
||||
|
||||
template<typename Sequence, typename Pos =
|
||||
typename result_of::begin<Sequence>::type>
|
||||
struct repetitive_view_iterator
|
||||
: iterator_base< repetitive_view_iterator<Sequence,Pos> >
|
||||
{
|
||||
typedef repetitive_view_iterator_tag fusion_tag;
|
||||
|
||||
typedef Sequence sequence_type;
|
||||
typedef typename convert_iterator<Pos>::type pos_type;
|
||||
typedef typename convert_iterator<typename result_of::begin<Sequence>::type>::type first_type;
|
||||
typedef typename convert_iterator<typename result_of::end<Sequence>::type>::type end_type;
|
||||
typedef single_pass_traversal_tag category;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit repetitive_view_iterator(Sequence& in_seq)
|
||||
: seq(in_seq), pos(begin(in_seq)) {}
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
repetitive_view_iterator(Sequence& in_seq, pos_type const& in_pos)
|
||||
: seq(in_seq), pos(in_pos) {}
|
||||
|
||||
Sequence& seq;
|
||||
pos_type pos;
|
||||
|
||||
private:
|
||||
// silence MSVC warning C4512: assignment operator could not be generated
|
||||
repetitive_view_iterator& operator= (repetitive_view_iterator const&);
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Sequence, typename Pos>
|
||||
struct iterator_traits< ::boost::fusion::repetitive_view_iterator<Sequence, Pos> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_SEQUENCE_VIEW_REVERSE_VIEW_10022005_0612)
|
||||
#define FUSION_SEQUENCE_VIEW_REVERSE_VIEW_10022005_0612
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/view/reverse_view/reverse_view.hpp>
|
||||
#include <boost/fusion/view/reverse_view/reverse_view_iterator.hpp>
|
||||
|
||||
#endif
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_ADVANCE_IMPL_14122005_2015)
|
||||
#define FUSION_ADVANCE_IMPL_14122005_2015
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/advance.hpp>
|
||||
#include <boost/mpl/negate.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct reverse_view_iterator_tag;
|
||||
|
||||
template <typename Iterator>
|
||||
struct reverse_view_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct advance_impl;
|
||||
|
||||
template<>
|
||||
struct advance_impl<reverse_view_iterator_tag>
|
||||
{
|
||||
template<typename Iterator, typename Dist>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Iterator::first_type first_type;
|
||||
typedef typename mpl::negate<Dist>::type negative_dist;
|
||||
typedef typename result_of::advance<first_type, negative_dist>::type advanced_type;
|
||||
typedef reverse_view_iterator<advanced_type> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type(boost::fusion::advance<negative_dist>(i.first));
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,43 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_AT_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_AT_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/at.hpp>
|
||||
#include <boost/mpl/minus.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct at_impl;
|
||||
|
||||
template <>
|
||||
struct at_impl<reverse_view_tag>
|
||||
{
|
||||
template <typename Seq, typename N>
|
||||
struct apply
|
||||
{
|
||||
typedef mpl::minus<typename Seq::size, mpl::int_<1>, N> real_n;
|
||||
|
||||
typedef typename
|
||||
result_of::at<typename Seq::seq_type, real_n>::type
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Seq& seq)
|
||||
{
|
||||
return fusion::at<real_n>(seq.seq);
|
||||
}
|
||||
};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_BEGIN_IMPL_07202005_0849)
|
||||
#define FUSION_BEGIN_IMPL_07202005_0849
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct reverse_view_tag;
|
||||
|
||||
template <typename Iterator>
|
||||
struct reverse_view_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct begin_impl;
|
||||
|
||||
template <>
|
||||
struct begin_impl<reverse_view_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef reverse_view_iterator<typename Sequence::last_type> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence const& s)
|
||||
{
|
||||
return type(s.last());
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_DEREF_DATA_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_DEREF_DATA_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/deref_data.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct deref_data_impl;
|
||||
|
||||
template <>
|
||||
struct deref_data_impl<reverse_view_iterator_tag>
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
{
|
||||
typedef typename
|
||||
result_of::deref_data<typename It::first_type>::type
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(It const& it)
|
||||
{
|
||||
return fusion::deref_data(it.first);
|
||||
}
|
||||
};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_DEREF_IMPL_07202005_0851)
|
||||
#define FUSION_DEREF_IMPL_07202005_0851
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/deref.hpp>
|
||||
#include <boost/fusion/iterator/prior.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct reverse_view_iterator_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct deref_impl;
|
||||
|
||||
template <>
|
||||
struct deref_impl<reverse_view_iterator_tag>
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef typename
|
||||
result_of::deref<
|
||||
typename result_of::prior<
|
||||
typename Iterator::first_type
|
||||
>::type
|
||||
>::type
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return *fusion::prior(i.first);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_DISTANCE_IMPL_14122005_2104)
|
||||
#define FUSION_DISTANCE_IMPL_14122005_2104
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/distance.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct reverse_view_iterator_tag;
|
||||
|
||||
template <typename Iterator>
|
||||
struct reverse_view_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct distance_impl;
|
||||
|
||||
template<>
|
||||
struct distance_impl<reverse_view_iterator_tag>
|
||||
{
|
||||
template<typename First, typename Last>
|
||||
struct apply
|
||||
{
|
||||
typedef typename First::first_type first_type;
|
||||
typedef typename Last::first_type last_type;
|
||||
typedef typename result_of::distance<last_type, first_type>::type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(First const& first, Last const& last)
|
||||
{
|
||||
return boost::fusion::distance(last.first, first.first);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_END_IMPL_07202005_0851)
|
||||
#define FUSION_END_IMPL_07202005_0851
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct reverse_view_tag;
|
||||
|
||||
template <typename Iterator>
|
||||
struct reverse_view_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct end_impl;
|
||||
|
||||
template <>
|
||||
struct end_impl<reverse_view_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef reverse_view_iterator<typename Sequence::first_type> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence const& s)
|
||||
{
|
||||
return type(s.first());
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_KEY_OF_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_KEY_OF_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/key_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct key_of_impl;
|
||||
|
||||
template <>
|
||||
struct key_of_impl<reverse_view_iterator_tag>
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
: result_of::key_of<typename It::it_type>
|
||||
{};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_NEXT_IMPL_07202005_0856)
|
||||
#define FUSION_NEXT_IMPL_07202005_0856
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/next.hpp>
|
||||
#include <boost/fusion/iterator/prior.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct reverse_view_iterator_tag;
|
||||
|
||||
template <typename Iterator>
|
||||
struct reverse_view_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <>
|
||||
struct next_impl<reverse_view_iterator_tag>
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Iterator::first_type first_type;
|
||||
typedef typename prior_impl<typename first_type::fusion_tag>::
|
||||
template apply<first_type>
|
||||
wrapped;
|
||||
|
||||
typedef reverse_view_iterator<typename wrapped::type> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type(wrapped::call(i.first));
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_PRIOR_IMPL_07202005_0857)
|
||||
#define FUSION_PRIOR_IMPL_07202005_0857
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/next.hpp>
|
||||
#include <boost/fusion/iterator/prior.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct reverse_view_iterator_tag;
|
||||
|
||||
template <typename Iterator>
|
||||
struct reverse_view_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <>
|
||||
struct prior_impl<reverse_view_iterator_tag>
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Iterator::first_type first_type;
|
||||
typedef typename next_impl<typename first_type::fusion_tag>::
|
||||
template apply<first_type>
|
||||
wrapped;
|
||||
|
||||
typedef reverse_view_iterator<typename wrapped::type> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type(wrapped::call(i.first));
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_VALUE_AT_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_VALUE_AT_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/value_at.hpp>
|
||||
#include <boost/mpl/minus.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct value_at_impl;
|
||||
|
||||
template <>
|
||||
struct value_at_impl<reverse_view_tag>
|
||||
{
|
||||
template <typename Seq, typename N>
|
||||
struct apply
|
||||
: result_of::value_at<
|
||||
typename Seq::seq_type
|
||||
, mpl::minus<typename Seq::size, mpl::int_<1>, N>
|
||||
>
|
||||
{};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/value_of_data.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct value_of_data_impl;
|
||||
|
||||
template <>
|
||||
struct value_of_data_impl<reverse_view_iterator_tag>
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
: result_of::value_of_data<typename It::first_type>
|
||||
{};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_VALUE_OF_IMPL_07202005_0900)
|
||||
#define FUSION_VALUE_OF_IMPL_07202005_0900
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/value_of.hpp>
|
||||
#include <boost/fusion/iterator/prior.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct reverse_view_iterator_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct value_of_impl;
|
||||
|
||||
template <>
|
||||
struct value_of_impl<reverse_view_iterator_tag>
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef typename
|
||||
result_of::value_of<
|
||||
typename result_of::prior<
|
||||
typename Iterator::first_type
|
||||
>::type
|
||||
>::type
|
||||
type;
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_REVERSE_VIEW_07202005_0836)
|
||||
#define FUSION_REVERSE_VIEW_07202005_0836
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/fusion/support/category_of.hpp>
|
||||
#include <boost/fusion/view/reverse_view/reverse_view_iterator.hpp>
|
||||
#include <boost/fusion/view/reverse_view/detail/begin_impl.hpp>
|
||||
#include <boost/fusion/view/reverse_view/detail/end_impl.hpp>
|
||||
#include <boost/fusion/view/reverse_view/detail/at_impl.hpp>
|
||||
#include <boost/fusion/view/reverse_view/detail/value_at_impl.hpp>
|
||||
#include <boost/fusion/support/sequence_base.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/inherit.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct reverse_view_tag;
|
||||
struct fusion_sequence_tag;
|
||||
|
||||
template <typename Sequence>
|
||||
struct reverse_view : sequence_base<reverse_view<Sequence> >
|
||||
{
|
||||
typedef reverse_view_tag fusion_tag;
|
||||
typedef fusion_sequence_tag tag; // this gets picked up by MPL
|
||||
typedef mpl::true_ is_view;
|
||||
|
||||
typedef Sequence seq_type;
|
||||
typedef typename traits::category_of<Sequence>::type category;
|
||||
typedef typename result_of::begin<Sequence>::type first_type;
|
||||
typedef typename result_of::end<Sequence>::type last_type;
|
||||
typedef typename result_of::size<Sequence>::type size;
|
||||
|
||||
BOOST_STATIC_ASSERT((
|
||||
is_base_of<
|
||||
bidirectional_traversal_tag
|
||||
, typename traits::category_of<first_type>::type>::value));
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
reverse_view(Sequence& in_seq)
|
||||
: seq(in_seq)
|
||||
{}
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
first_type first() const { return fusion::begin(seq); }
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
last_type last() const { return fusion::end(seq); }
|
||||
typename mpl::if_<traits::is_view<Sequence>, Sequence, Sequence&>::type seq;
|
||||
|
||||
private:
|
||||
// silence MSVC warning C4512: assignment operator could not be generated
|
||||
reverse_view& operator= (reverse_view const&);
|
||||
};
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_REVERSE_VIEW_ITERATOR_07202005_0835)
|
||||
#define FUSION_REVERSE_VIEW_ITERATOR_07202005_0835
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/support/iterator_base.hpp>
|
||||
#include <boost/fusion/support/category_of.hpp>
|
||||
#include <boost/fusion/iterator/mpl/convert_iterator.hpp>
|
||||
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
|
||||
#include <boost/fusion/view/reverse_view/detail/deref_impl.hpp>
|
||||
#include <boost/fusion/view/reverse_view/detail/next_impl.hpp>
|
||||
#include <boost/fusion/view/reverse_view/detail/prior_impl.hpp>
|
||||
#include <boost/fusion/view/reverse_view/detail/advance_impl.hpp>
|
||||
#include <boost/fusion/view/reverse_view/detail/distance_impl.hpp>
|
||||
#include <boost/fusion/view/reverse_view/detail/value_of_impl.hpp>
|
||||
#include <boost/fusion/view/reverse_view/detail/deref_data_impl.hpp>
|
||||
#include <boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp>
|
||||
#include <boost/fusion/view/reverse_view/detail/key_of_impl.hpp>
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct reverse_view_iterator_tag;
|
||||
|
||||
template <typename First>
|
||||
struct reverse_view_iterator
|
||||
: iterator_base<reverse_view_iterator<First> >
|
||||
{
|
||||
typedef convert_iterator<First> converter;
|
||||
typedef typename converter::type first_type;
|
||||
typedef reverse_view_iterator_tag fusion_tag;
|
||||
typedef typename traits::category_of<first_type>::type category;
|
||||
|
||||
BOOST_STATIC_ASSERT((
|
||||
is_base_of<
|
||||
bidirectional_traversal_tag
|
||||
, category>::value));
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
reverse_view_iterator(First const& in_first)
|
||||
: first(converter::call(in_first)) {}
|
||||
|
||||
first_type first;
|
||||
|
||||
private:
|
||||
// silence MSVC warning C4512: assignment operator could not be generated
|
||||
reverse_view_iterator& operator= (reverse_view_iterator const&);
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename First>
|
||||
struct iterator_traits< ::boost::fusion::reverse_view_iterator<First> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_SINGLE_VIEW_03192006_2216)
|
||||
#define FUSION_SINGLE_VIEW_03192006_2216
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/view/single_view/single_view.hpp>
|
||||
#include <boost/fusion/view/single_view/single_view_iterator.hpp>
|
||||
|
||||
#endif
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_SINGLE_VIEW_ADVANCE_IMPL_JUL_07_2011_1348PM)
|
||||
#define BOOST_FUSION_SINGLE_VIEW_ADVANCE_IMPL_JUL_07_2011_1348PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/plus.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct single_view_iterator_tag;
|
||||
|
||||
template <typename SingleView, typename Pos>
|
||||
struct single_view_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct advance_impl;
|
||||
|
||||
template<>
|
||||
struct advance_impl<single_view_iterator_tag>
|
||||
{
|
||||
template<typename Iterator, typename Dist>
|
||||
struct apply
|
||||
{
|
||||
typedef single_view_iterator<
|
||||
typename Iterator::single_view_type,
|
||||
typename mpl::plus<typename Iterator::position, Dist>::type>
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type(i.view);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,46 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_SINGLE_VIEW_AT_IMPL_JUL_07_2011_1348PM)
|
||||
#define BOOST_FUSION_SINGLE_VIEW_AT_IMPL_JUL_07_2011_1348PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/equal_to.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct single_view_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct at_impl;
|
||||
|
||||
template<>
|
||||
struct at_impl<single_view_tag>
|
||||
{
|
||||
template<typename Sequence, typename N>
|
||||
struct apply
|
||||
{
|
||||
BOOST_MPL_ASSERT((mpl::equal_to<N, mpl::int_<0> >));
|
||||
typedef typename Sequence::value_type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence& seq)
|
||||
{
|
||||
return seq.val;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_SINGLE_VIEW_BEGIN_IMPL_05052005_0305)
|
||||
#define BOOST_FUSION_SINGLE_VIEW_BEGIN_IMPL_05052005_0305
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct single_view_tag;
|
||||
|
||||
template <typename SingleView, typename Pos>
|
||||
struct single_view_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct begin_impl;
|
||||
|
||||
template <>
|
||||
struct begin_impl<single_view_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef single_view_iterator<Sequence, mpl::int_<0> > type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence& seq)
|
||||
{
|
||||
return type(seq);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_SINGLE_VIEW_DEREF_IMPL_05052005_0258)
|
||||
#define BOOST_FUSION_SINGLE_VIEW_DEREF_IMPL_05052005_0258
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/equal_to.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct single_view_iterator_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct deref_impl;
|
||||
|
||||
template <>
|
||||
struct deref_impl<single_view_iterator_tag>
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
BOOST_MPL_ASSERT((mpl::equal_to<typename Iterator::position, mpl::int_<0> >));
|
||||
typedef typename Iterator::value_type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return i.view.val;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_SINGLE_VIEW_DISTANCE_IMPL_JUL_07_2011_1348PM)
|
||||
#define BOOST_FUSION_SINGLE_VIEW_DISTANCE_IMPL_JUL_07_2011_1348PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/minus.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct single_view_iterator_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct distance_impl;
|
||||
|
||||
template<>
|
||||
struct distance_impl<single_view_iterator_tag>
|
||||
{
|
||||
template<typename First, typename Last>
|
||||
struct apply
|
||||
: mpl::minus<typename Last::position, typename First::position>
|
||||
{
|
||||
typedef typename mpl::minus<typename Last::position,
|
||||
typename First::position>::type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(First const& /*first*/, Last const& /*last*/)
|
||||
{
|
||||
return type();
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,47 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_SINGLE_VIEW_END_IMPL_05052005_0332)
|
||||
#define BOOST_FUSION_SINGLE_VIEW_END_IMPL_05052005_0332
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct single_view_tag;
|
||||
|
||||
template <typename SingleView, typename Pos>
|
||||
struct single_view_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct end_impl;
|
||||
|
||||
template <>
|
||||
struct end_impl<single_view_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef single_view_iterator<Sequence, mpl::int_<1> > type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence& seq)
|
||||
{
|
||||
return type(seq);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_SINGLE_VIEW_ITERATOR_JUL_07_2011_1348PM)
|
||||
#define BOOST_FUSION_SINGLE_VIEW_ITERATOR_JUL_07_2011_1348PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/equal_to.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct single_view_iterator_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct equal_to_impl;
|
||||
|
||||
template<>
|
||||
struct equal_to_impl<single_view_iterator_tag>
|
||||
{
|
||||
template<typename It1, typename It2>
|
||||
struct apply
|
||||
: mpl::equal_to<typename It1::position, typename It2::position>
|
||||
{
|
||||
BOOST_MPL_ASSERT((is_same<typename add_const<typename It1::single_view_type>::type,
|
||||
typename add_const<typename It2::single_view_type>::type>));
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_SINGLE_VIEW_NEXT_IMPL_05052005_0331)
|
||||
#define BOOST_FUSION_SINGLE_VIEW_NEXT_IMPL_05052005_0331
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/next.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct single_view_iterator_tag;
|
||||
|
||||
template <typename SingleView, typename Pos>
|
||||
struct single_view_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct next_impl;
|
||||
|
||||
template <>
|
||||
struct next_impl<single_view_iterator_tag>
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef single_view_iterator<
|
||||
typename Iterator::single_view_type,
|
||||
typename mpl::next<typename Iterator::position>::type>
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
// Workaround for ICE on GCC 4.0.0.
|
||||
// see https://svn.boost.org/trac/boost/ticket/5808
|
||||
typedef typename type::position position;
|
||||
BOOST_STATIC_ASSERT((position::value < 2));
|
||||
return type(i.view);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_SINGLE_VIEW_PRIOR_IMPL_JUL_07_2011_1348PM)
|
||||
#define BOOST_FUSION_SINGLE_VIEW_PRIOR_IMPL_JUL_07_2011_1348PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/prior.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct single_view_iterator_tag;
|
||||
|
||||
template <typename Sequence, typename Pos>
|
||||
struct single_view_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct prior_impl;
|
||||
|
||||
template <>
|
||||
struct prior_impl<single_view_iterator_tag>
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef single_view_iterator<
|
||||
typename Iterator::single_view_type,
|
||||
typename mpl::prior<typename Iterator::position>::type>
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type(i.view);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_SINGLE_VIEW_SIZE_IMPL_JUL_07_2011_1348PM)
|
||||
#define FUSION_SINGLE_VIEW_SIZE_IMPL_JUL_07_2011_1348PM
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct single_view_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct size_impl;
|
||||
|
||||
template <>
|
||||
struct size_impl<single_view_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef mpl::int_<1> type;
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_SINGLE_VIEW_VALUE_AT_IMPL_JUL_07_2011_1348PM)
|
||||
#define BOOST_FUSION_SINGLE_VIEW_VALUE_AT_IMPL_JUL_07_2011_1348PM
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/value_at.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct single_view_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct value_at_impl;
|
||||
|
||||
template<>
|
||||
struct value_at_impl<single_view_tag>
|
||||
{
|
||||
template<typename Sequence, typename N>
|
||||
struct apply
|
||||
{
|
||||
BOOST_MPL_ASSERT((mpl::equal_to<N, mpl::int_<0> >));
|
||||
typedef typename Sequence::value_type type;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_SINGLE_VIEW_VALUE_OF_IMPL_05052005_0324)
|
||||
#define BOOST_FUSION_SINGLE_VIEW_VALUE_OF_IMPL_05052005_0324
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/equal_to.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct single_view_iterator_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct value_of_impl;
|
||||
|
||||
template <>
|
||||
struct value_of_impl<single_view_iterator_tag>
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
BOOST_MPL_ASSERT((mpl::equal_to<typename Iterator::position, mpl::int_<0> >));
|
||||
typedef typename Iterator::value_type type;
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_SINGLE_VIEW_05052005_0335)
|
||||
#define BOOST_FUSION_SINGLE_VIEW_05052005_0335
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/fusion/support/detail/as_fusion_element.hpp>
|
||||
#include <boost/fusion/support/sequence_base.hpp>
|
||||
#include <boost/fusion/view/single_view/single_view_iterator.hpp>
|
||||
#include <boost/fusion/view/single_view/detail/at_impl.hpp>
|
||||
#include <boost/fusion/view/single_view/detail/begin_impl.hpp>
|
||||
#include <boost/fusion/view/single_view/detail/end_impl.hpp>
|
||||
#include <boost/fusion/view/single_view/detail/size_impl.hpp>
|
||||
#include <boost/fusion/view/single_view/detail/value_at_impl.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined (BOOST_MSVC)
|
||||
# pragma warning(push)
|
||||
# pragma warning (disable: 4512) // assignment operator could not be generated.
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct single_view_tag;
|
||||
struct random_access_traversal_tag;
|
||||
struct fusion_sequence_tag;
|
||||
|
||||
template <typename T>
|
||||
struct single_view : sequence_base<single_view<T> >
|
||||
{
|
||||
typedef single_view_tag fusion_tag;
|
||||
typedef fusion_sequence_tag tag; // this gets picked up by MPL
|
||||
typedef random_access_traversal_tag category;
|
||||
typedef mpl::true_ is_view;
|
||||
typedef mpl::int_<1> size;
|
||||
typedef T value_type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
single_view()
|
||||
: val() {}
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit single_view(typename detail::call_param<T>::type in_val)
|
||||
: val(in_val) {}
|
||||
|
||||
value_type val;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline single_view<typename detail::as_fusion_element<T>::type>
|
||||
make_single_view(T const& v)
|
||||
{
|
||||
return single_view<typename detail::as_fusion_element<T>::type>(v);
|
||||
}
|
||||
}}
|
||||
|
||||
#if defined (BOOST_MSVC)
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_SINGLE_VIEW_ITERATOR_05052005_0340)
|
||||
#define BOOST_FUSION_SINGLE_VIEW_ITERATOR_05052005_0340
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/fusion/support/iterator_base.hpp>
|
||||
#include <boost/fusion/view/single_view/detail/deref_impl.hpp>
|
||||
#include <boost/fusion/view/single_view/detail/next_impl.hpp>
|
||||
#include <boost/fusion/view/single_view/detail/prior_impl.hpp>
|
||||
#include <boost/fusion/view/single_view/detail/advance_impl.hpp>
|
||||
#include <boost/fusion/view/single_view/detail/distance_impl.hpp>
|
||||
#include <boost/fusion/view/single_view/detail/equal_to_impl.hpp>
|
||||
#include <boost/fusion/view/single_view/detail/value_of_impl.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined (BOOST_MSVC)
|
||||
# pragma warning(push)
|
||||
# pragma warning (disable: 4512) // assignment operator could not be generated.
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct single_view_iterator_tag;
|
||||
struct random_access_traversal_tag;
|
||||
|
||||
template <typename SingleView, typename Pos>
|
||||
struct single_view_iterator
|
||||
: iterator_base<single_view_iterator<SingleView, Pos> >
|
||||
{
|
||||
typedef single_view_iterator_tag fusion_tag;
|
||||
typedef random_access_traversal_tag category;
|
||||
typedef typename SingleView::value_type value_type;
|
||||
typedef Pos position;
|
||||
typedef SingleView single_view_type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit single_view_iterator(single_view_type& in_view)
|
||||
: view(in_view) {}
|
||||
|
||||
SingleView& view;
|
||||
|
||||
private:
|
||||
single_view_iterator& operator=(single_view_iterator const&);
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename SingleView, typename Pos>
|
||||
struct iterator_traits< ::boost::fusion::single_view_iterator<SingleView, Pos> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined (BOOST_MSVC)
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_SEQUENCE_VIEW_TRANSFORM_VIEW_10022005_0612)
|
||||
#define FUSION_SEQUENCE_VIEW_TRANSFORM_VIEW_10022005_0612
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/view/transform_view/transform_view.hpp>
|
||||
#include <boost/fusion/view/transform_view/transform_view_iterator.hpp>
|
||||
|
||||
#endif
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_ADVANCE_IMPL_13122005_1906)
|
||||
#define FUSION_ADVANCE_IMPL_13122005_1906
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/advance.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct transform_view_iterator_tag;
|
||||
struct transform_view_iterator2_tag;
|
||||
|
||||
template<typename First, typename F>
|
||||
struct transform_view_iterator;
|
||||
|
||||
template <typename First1, typename First2, typename F>
|
||||
struct transform_view_iterator2;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct advance_impl;
|
||||
|
||||
// Unary Version
|
||||
template<>
|
||||
struct advance_impl<transform_view_iterator_tag>
|
||||
{
|
||||
template<typename Iterator, typename Dist>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Iterator::first_type first_type;
|
||||
typedef typename result_of::advance<first_type, Dist>::type advanced_type;
|
||||
typedef typename Iterator::transform_type transform_type;
|
||||
typedef transform_view_iterator<advanced_type, transform_type> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type(boost::fusion::advance<Dist>(i.first), i.f);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// Binary Version
|
||||
template<>
|
||||
struct advance_impl<transform_view_iterator2_tag>
|
||||
{
|
||||
template<typename Iterator, typename Dist>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Iterator::first1_type first1_type;
|
||||
typedef typename Iterator::first2_type first2_type;
|
||||
typedef typename result_of::advance<first1_type, Dist>::type advanced1_type;
|
||||
typedef typename result_of::advance<first2_type, Dist>::type advanced2_type;
|
||||
typedef typename Iterator::transform_type transform_type;
|
||||
typedef transform_view_iterator2<advanced1_type, advanced2_type, transform_type> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type(
|
||||
boost::fusion::advance<Dist>(i.first1)
|
||||
, boost::fusion::advance<Dist>(i.first2), i.f);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2007 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_APPLY_TRANSFORM_RESULT_02092006_1936)
|
||||
#define BOOST_FUSION_APPLY_TRANSFORM_RESULT_02092006_1936
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/utility/result_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct void_;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template <typename F>
|
||||
struct apply_transform_result
|
||||
{
|
||||
template <typename T0, typename T1 = void_>
|
||||
struct apply
|
||||
: boost::result_of<F(T0, T1)>
|
||||
{};
|
||||
|
||||
template <typename T0>
|
||||
struct apply<T0, void_>
|
||||
: boost::result_of<F(T0)>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_AT_IMPL_20061029_1946)
|
||||
#define BOOST_FUSION_AT_IMPL_20061029_1946
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/apply.hpp>
|
||||
#include <boost/fusion/view/transform_view/detail/apply_transform_result.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/at.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
struct transform_view_tag;
|
||||
struct transform_view2_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct at_impl;
|
||||
|
||||
template<>
|
||||
struct at_impl<transform_view_tag>
|
||||
{
|
||||
template<typename Seq, typename N>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Seq::transform_type F;
|
||||
typedef detail::apply_transform_result<F> transform_type;
|
||||
typedef typename boost::fusion::result_of::at<typename Seq::sequence_type, N>::type value_type;
|
||||
typedef typename mpl::apply<transform_type, value_type>::type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Seq& seq)
|
||||
{
|
||||
return seq.f(boost::fusion::at<N>(seq.seq));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct at_impl<transform_view2_tag>
|
||||
{
|
||||
template<typename Seq, typename N>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Seq::transform_type F;
|
||||
typedef detail::apply_transform_result<F> transform_type;
|
||||
typedef typename boost::fusion::result_of::at<typename Seq::sequence1_type, N>::type value1_type;
|
||||
typedef typename boost::fusion::result_of::at<typename Seq::sequence2_type, N>::type value2_type;
|
||||
typedef typename mpl::apply<transform_type, value1_type, value2_type>::type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Seq& seq)
|
||||
{
|
||||
return seq.f(boost::fusion::at<N>(seq.seq1), boost::fusion::at<N>(seq.seq2));
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user