]> git.donarmstrong.com Git - rsem.git/blob - boost/fusion/view/single_view/detail/distance_impl.hpp
Updated boost to v1.55.0
[rsem.git] / boost / fusion / view / single_view / detail / distance_impl.hpp
1 /*=============================================================================
2     Copyright (c) 2011 Eric Niebler
3
4     Distributed under the Boost Software License, Version 1.0. (See accompanying
5     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7
8 #if !defined(BOOST_FUSION_SINGLE_VIEW_DISTANCE_IMPL_JUL_07_2011_1348PM)
9 #define BOOST_FUSION_SINGLE_VIEW_DISTANCE_IMPL_JUL_07_2011_1348PM
10
11 #include <boost/mpl/minus.hpp>
12
13 namespace boost { namespace fusion 
14 {
15     struct single_view_iterator_tag;
16
17     namespace extension
18     {
19         template<typename Tag>
20         struct distance_impl;
21
22         template<>
23         struct distance_impl<single_view_iterator_tag>
24         {
25             template<typename First, typename Last>
26             struct apply
27               : mpl::minus<typename Last::position, typename First::position>
28             {
29                 typedef typename mpl::minus<typename Last::position,
30                     typename First::position>::type type;
31
32                 static type
33                 call(First const& /*first*/, Last const& /*last*/)
34                 {
35                     return type();
36                 }
37             };
38         };
39     }
40
41 }}
42
43 #endif