]> git.donarmstrong.com Git - rsem.git/blob - boost/fusion/container/vector/detail/distance_impl.hpp
Updated boost to v1.55.0
[rsem.git] / boost / fusion / container / vector / detail / distance_impl.hpp
1 /*=============================================================================
2     Copyright (c) 2001-2011 Joel de Guzman
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 #if !defined(FUSION_DISTANCE_IMPL_09172005_0751)
8 #define FUSION_DISTANCE_IMPL_09172005_0751
9
10 #include <boost/mpl/minus.hpp>
11
12 namespace boost { namespace fusion
13 {
14     struct vector_iterator_tag;
15
16     namespace extension
17     {
18         template <typename Tag>
19         struct distance_impl;
20
21         template <>
22         struct distance_impl<vector_iterator_tag>
23         {
24             template <typename First, typename Last>
25             struct apply : mpl::minus<typename Last::index, typename First::index>
26             {    
27                 static typename mpl::minus<
28                     typename Last::index, typename First::index>::type
29                 call(First const&, Last const&)
30                 {
31                     typedef typename mpl::minus<
32                         typename Last::index, typename First::index>::type 
33                     result;
34                     return result();
35                 }
36             };
37         };
38     }
39 }}
40
41 #endif