Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:35:00

0001 /*=============================================================================
0002     Copyright (c) 2001-2011 Joel de Guzman
0003     Copyright (c) 2005-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_DISTANCE_IMPL_13122005_2139)
0009 #define FUSION_DISTANCE_IMPL_13122005_2139
0010 
0011 #include <boost/fusion/support/config.hpp>
0012 #include <boost/fusion/iterator/distance.hpp>
0013 
0014 namespace boost { namespace fusion {
0015     
0016     struct transform_view_iterator_tag;
0017     struct transform_view_iterator2_tag;
0018 
0019     namespace extension
0020     {
0021         template<typename Tag>
0022         struct distance_impl;
0023 
0024         // Unary Version
0025         template<>
0026         struct distance_impl<transform_view_iterator_tag>
0027         {
0028             template<typename First, typename Last>
0029             struct apply
0030                 : result_of::distance<typename First::first_type, typename Last::first_type>
0031             {
0032                 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0033                 static 
0034                 typename result_of::distance<typename First::first_type, typename Last::first_type>::type
0035                 call(First const& first, Last const& last)
0036                 {
0037                     return boost::fusion::distance(first.first, last.first);
0038                 }
0039             };
0040         };
0041 
0042         // Binary Version
0043         template<>
0044         struct distance_impl<transform_view_iterator2_tag>
0045         {
0046             template<typename First, typename Last>
0047             struct apply
0048                 : result_of::distance<typename First::first1_type, typename Last::first1_type>
0049             {
0050                 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0051                 static 
0052                 typename result_of::distance<typename First::first1_type, typename Last::first1_type>::type
0053                 call(First const& first, Last const& last)
0054                 {
0055                     return boost::fusion::distance(first.first1, last.first1);
0056                 }
0057             };
0058         };
0059     }
0060 }}
0061 
0062 #endif