]> git.donarmstrong.com Git - rsem.git/blob - boost/fusion/view/iterator_range/detail/at_impl.hpp
Updated boost to v1.55.0
[rsem.git] / boost / fusion / view / iterator_range / detail / at_impl.hpp
1 /*=============================================================================
2     Copyright (c) 2007 Tobias Schwinger
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_ITERATOR_RANGE_AT_IMPL_HPP_INCLUDED)
9 #define BOOST_FUSION_ITERATOR_RANGE_AT_IMPL_HPP_INCLUDED
10
11 #include <boost/fusion/iterator/advance.hpp>
12 #include <boost/fusion/iterator/deref.hpp>
13
14 namespace boost { namespace fusion
15 {
16     struct iterator_range_tag;
17
18     namespace extension
19     {
20         template <typename Tag>
21         struct at_impl;
22
23         template <>
24         struct at_impl<iterator_range_tag>
25         {
26             template <typename Seq, typename N>
27             struct apply
28             {
29                 typedef typename Seq::begin_type begin_type;
30                 typedef typename result_of::advance<begin_type,N>::type pos;
31                 typedef typename result_of::deref<pos>::type type;
32
33                 static type
34                 call(Seq& s)
35                 {
36                     return * fusion::advance<N>(s.first);
37                 }
38             };
39         };
40     }
41 }}
42
43 #endif
44