12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- #if !defined(FUSION_BEGIN_IMPL_20060123_2147)
- #define FUSION_BEGIN_IMPL_20060123_2147
- #include <boost/fusion/support/config.hpp>
- #include <boost/fusion/sequence/intrinsic/begin.hpp>
- #include <boost/fusion/view/zip_view/zip_view_iterator_fwd.hpp>
- #include <boost/fusion/algorithm/transformation/transform.hpp>
- #include <boost/type_traits/remove_reference.hpp>
- #include <boost/type_traits/is_reference.hpp>
- #include <boost/type_traits/is_same.hpp>
- #include <boost/mpl/assert.hpp>
- #include <boost/mpl/eval_if.hpp>
- #include <boost/mpl/identity.hpp>
- #include <boost/fusion/support/unused.hpp>
- namespace boost { namespace fusion {
- struct zip_view_tag;
- namespace detail
- {
- struct poly_begin
- {
- template<typename T>
- struct result;
- template<typename SeqRef>
- struct result<poly_begin(SeqRef)>
- : mpl::eval_if<is_same<SeqRef, unused_type const&>,
- mpl::identity<unused_type>,
- result_of::begin<typename remove_reference<SeqRef>::type> >
- {
- BOOST_MPL_ASSERT((is_reference<SeqRef>));
- };
- template<typename Seq>
- BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
- typename result<poly_begin(Seq&)>::type
- operator()(Seq& seq) const
- {
- return fusion::begin(seq);
- }
- template<typename Seq>
- BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
- typename result<poly_begin(Seq const&)>::type
- operator()(Seq const& seq) const
- {
- return fusion::begin(seq);
- }
- BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
- unused_type operator()(unused_type const&) const
- {
- return unused_type();
- }
- };
- }
- namespace extension
- {
- template<typename Tag>
- struct begin_impl;
- template<>
- struct begin_impl<zip_view_tag>
- {
- template<typename Sequence>
- struct apply
- {
- typedef zip_view_iterator<
- typename result_of::transform<typename Sequence::sequences, detail::poly_begin>::type,
- typename Sequence::category> type;
- BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
- static type
- call(Sequence& sequence)
- {
- return type(
- fusion::transform(sequence.sequences_, detail::poly_begin()));
- }
- };
-
- };
- }
- }}
- #endif
|