Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:41:56

0001 /*=============================================================================
0002     Copyright (c) 2001-2011 Joel de Guzman
0003     Copyright (c) 2006 Dan Marsden
0004 
0005     Distributed under the Boost Software License, Version 1.0. (See accompanying 
0006     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 ==============================================================================*/
0008 #if !defined(FUSION_ADVANCE_IMPL_20061024_2021)
0009 #define FUSION_ADVANCE_IMPL_20061024_2021
0010 
0011 #include <boost/fusion/support/config.hpp>
0012 #include <boost/fusion/view/zip_view/zip_view_iterator_fwd.hpp>
0013 #include <boost/fusion/iterator/advance.hpp>
0014 #include <boost/fusion/algorithm/transformation/transform.hpp>
0015 #include <boost/type_traits/remove_reference.hpp>
0016 
0017 namespace boost { namespace fusion {
0018 
0019     struct zip_view_iterator_tag;
0020 
0021     namespace detail
0022     {
0023         template<typename N>
0024         struct poly_advance
0025         {
0026             template<typename Sig>
0027             struct result;
0028 
0029             template<typename N1, typename It>
0030             struct result<poly_advance<N1>(It)>
0031             {
0032                 typedef typename remove_reference<It>::type it;
0033                 typedef typename result_of::advance<it,N>::type type;
0034             };
0035 
0036             template<typename It>
0037             BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0038             typename result<poly_advance(It)>::type
0039             operator()(const It& it) const
0040             {
0041                 return fusion::advance<N>(it);
0042             }
0043         };
0044     }
0045 
0046     namespace extension
0047     {
0048         template<typename Tag>
0049         struct advance_impl;
0050 
0051         template<>
0052         struct advance_impl<zip_view_iterator_tag>
0053         {
0054             template<typename It, typename N>
0055             struct apply
0056             {
0057                 typedef zip_view_iterator<
0058                     typename result_of::transform<typename It::iterators, detail::poly_advance<N> >::type> type;
0059 
0060                 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0061                 static type
0062                 call(It const& it)
0063                 {
0064                     return type(
0065                         fusion::transform(it.iterators_, detail::poly_advance<N>()));
0066                 }
0067             };
0068         };
0069     }
0070 }}
0071 
0072 #endif