]> git.donarmstrong.com Git - rsem.git/blob - boost/fusion/tuple/tuple.hpp
Added posterior standard deviation of counts as output if either '--calc-pme' or...
[rsem.git] / boost / fusion / tuple / tuple.hpp
1 /*=============================================================================
2     Copyright (c) 2005 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_TUPLE_10032005_0810)
8 #define FUSION_TUPLE_10032005_0810
9
10 #include <boost/fusion/tuple/tuple_fwd.hpp>
11 #include <boost/fusion/container/vector/vector.hpp>
12 #include <boost/fusion/sequence/intrinsic/size.hpp>
13 #include <boost/fusion/sequence/intrinsic/value_at.hpp>
14 #include <boost/fusion/sequence/intrinsic/at.hpp>
15 #include <boost/fusion/sequence/comparison.hpp>
16 #include <boost/fusion/sequence/io.hpp>
17 #include <boost/utility/enable_if.hpp>
18 #include <boost/type_traits/is_const.hpp>
19 #include <boost/config/no_tr1/utility.hpp>
20
21 namespace boost { namespace fusion
22 {
23     template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, typename T)>
24     struct tuple : vector<BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)>
25     {
26         typedef vector<
27             BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)>
28         base_type;
29
30         tuple()
31             : base_type() {}
32
33         tuple(tuple const& rhs)
34             : base_type(rhs) {}
35
36         template <typename U1, typename U2>
37         tuple(std::pair<U1, U2> const& rhs)
38             : base_type(rhs) {}
39
40         #include <boost/fusion/tuple/detail/tuple_expand.hpp>
41
42         template <typename T>
43         tuple& operator=(T const& rhs)
44         {
45             base_type::operator=(rhs);
46             return *this;
47         }
48
49         tuple& operator=(tuple const& rhs)
50         {
51             base_type::operator=(rhs);
52             return *this;
53         }
54
55         template <typename U1, typename U2>
56         tuple& operator=(std::pair<U1, U2> const& rhs)
57         {
58             base_type::operator=(rhs);
59             return *this;
60         }
61     };
62
63     template <typename Tuple>
64     struct tuple_size : result_of::size<Tuple> {};
65
66     template <int N, typename Tuple>
67     struct tuple_element : result_of::value_at_c<Tuple, N> {};
68
69     template <int N, typename Tuple>
70     inline typename
71         lazy_disable_if<
72             is_const<Tuple>
73           , result_of::at_c<Tuple, N>
74         >::type
75     get(Tuple& tup)
76     {
77         return at_c<N>(tup);
78     }
79
80     template <int N, typename Tuple>
81     inline typename result_of::at_c<Tuple const, N>::type
82     get(Tuple const& tup)
83     {
84         return at_c<N>(tup);
85     }
86 }}
87
88 #endif