1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
3 Copyright (c) 2005-2006 Dan Marsden
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #if !defined(FUSION_DISTANCE_IMPL_14122005_2104)
9 #define FUSION_DISTANCE_IMPL_14122005_2104
11 #include <boost/fusion/support/config.hpp>
12 #include <boost/fusion/iterator/distance.hpp>
14 namespace boost { namespace fusion {
16 struct reverse_view_iterator_tag;
18 template <typename Iterator>
19 struct reverse_view_iterator;
23 template<typename Tag>
27 struct distance_impl<reverse_view_iterator_tag>
29 template<typename First, typename Last>
32 typedef typename First::first_type first_type;
33 typedef typename Last::first_type last_type;
34 typedef typename result_of::distance<last_type, first_type>::type type;
36 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
38 call(First const& first, Last const& last)
40 return boost::fusion::distance(last.first, first.first);