]> git.donarmstrong.com Git - rsem.git/blob - boost/fusion/container/vector/detail/at_impl.hpp
Updated boost to v1.55.0
[rsem.git] / boost / fusion / container / vector / detail / at_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_AT_IMPL_05042005_0741)
8 #define FUSION_AT_IMPL_05042005_0741
9
10 #include <boost/fusion/support/detail/access.hpp>
11 #include <boost/type_traits/is_const.hpp>
12 #include <boost/mpl/at.hpp>
13 #include <boost/mpl/int.hpp>
14
15 namespace boost { namespace fusion
16 {
17     struct vector_tag;
18
19     namespace extension
20     {
21         template <typename Tag>
22         struct at_impl;
23
24         template <>
25         struct at_impl<vector_tag>
26         {
27             template <typename Sequence, typename N>
28             struct apply 
29             {
30                 typedef typename mpl::at<typename Sequence::types, N>::type element;
31                 typedef typename detail::ref_result<element>::type type;
32     
33                 static type
34                 call(Sequence& v)
35                 {
36                     return v.at_impl(N());
37                 }
38             };
39
40             template <typename Sequence, typename N>
41             struct apply <Sequence const, N>
42             {
43                 typedef typename mpl::at<typename Sequence::types, N>::type element;
44                 typedef typename detail::cref_result<element>::type type;
45     
46                 static type
47                 call(Sequence const& v)
48                 {
49                     return v.at_impl(N());
50                 }
51             };
52         };
53     }
54 }}
55
56 #endif