]> git.donarmstrong.com Git - rsem.git/blob - boost/fusion/sequence/intrinsic/value_at.hpp
Updated boost to v1.55.0
[rsem.git] / boost / fusion / sequence / intrinsic / value_at.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_VALUE_AT_05052005_0229)
8 #define FUSION_VALUE_AT_05052005_0229
9
10 #include <boost/mpl/int.hpp>
11 #include <boost/fusion/sequence/intrinsic_fwd.hpp>
12 #include <boost/fusion/support/tag_of.hpp>
13
14 namespace boost { namespace fusion
15 {
16     // Special tags:
17     struct sequence_facade_tag;
18     struct boost_tuple_tag; // boost::tuples::tuple tag
19     struct boost_array_tag; // boost::array tag
20     struct mpl_sequence_tag; // mpl sequence tag
21     struct std_pair_tag; // std::pair tag
22
23     namespace extension
24     {
25         template <typename Tag>
26         struct value_at_impl
27         {
28             template <typename Sequence, typename N>
29             struct apply;
30         };
31
32         template <>
33         struct value_at_impl<sequence_facade_tag>
34         {
35             template <typename Sequence, typename N>
36             struct apply : Sequence::template value_at<Sequence, N> {};
37         };
38
39         template <>
40         struct value_at_impl<boost_tuple_tag>;
41
42         template <>
43         struct value_at_impl<boost_array_tag>;
44
45         template <>
46         struct value_at_impl<mpl_sequence_tag>;
47
48         template <>
49         struct value_at_impl<std_pair_tag>;
50     }
51
52     namespace result_of
53     {
54         template <typename Sequence, typename N>
55         struct value_at
56             : extension::value_at_impl<typename detail::tag_of<Sequence>::type>::
57                 template apply<Sequence, N>
58         {};
59
60         template <typename Sequence, int N>
61         struct value_at_c
62             : fusion::result_of::value_at<Sequence, mpl::int_<N> >
63         {};
64     }
65 }}
66
67 #endif
68