]> git.donarmstrong.com Git - rsem.git/blob - boost/fusion/tuple/make_tuple.hpp
32fd912eec902b42fd9de7c78370ab226886e562
[rsem.git] / boost / fusion / tuple / make_tuple.hpp
1 /*=============================================================================
2     Copyright (c) 2001-2006 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 #ifndef BOOST_PP_IS_ITERATING
8 #if !defined(FUSION_MAKE_TUPLE_10032005_0843)
9 #define FUSION_MAKE_TUPLE_10032005_0843
10
11 #include <boost/preprocessor/iterate.hpp>
12 #include <boost/preprocessor/repetition/enum_params.hpp>
13 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
14 #include <boost/fusion/tuple/tuple.hpp>
15 #include <boost/fusion/support/detail/as_fusion_element.hpp>
16
17 namespace boost { namespace fusion
18 {
19     inline tuple<>
20     make_tuple()
21     {
22         return tuple<>();
23     }
24
25 #define BOOST_FUSION_AS_FUSION_ELEMENT(z, n, data)                               \
26     typename detail::as_fusion_element<BOOST_PP_CAT(T, n)>::type
27
28 #define BOOST_PP_FILENAME_1 <boost/fusion/tuple/make_tuple.hpp>
29 #define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE)
30 #include BOOST_PP_ITERATE()
31
32 #undef BOOST_FUSION_AS_FUSION_ELEMENT
33
34 }}
35
36 #endif
37 #else // defined(BOOST_PP_IS_ITERATING)
38 ///////////////////////////////////////////////////////////////////////////////
39 //
40 //  Preprocessor vertical repetition code
41 //
42 ///////////////////////////////////////////////////////////////////////////////
43
44 #define N BOOST_PP_ITERATION()
45
46     template <BOOST_PP_ENUM_PARAMS(N, typename T)>
47     inline tuple<BOOST_PP_ENUM(N, BOOST_FUSION_AS_FUSION_ELEMENT, _)>
48     make_tuple(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& _))
49     {
50         return tuple<BOOST_PP_ENUM(N, BOOST_FUSION_AS_FUSION_ELEMENT, _)>(
51             BOOST_PP_ENUM_PARAMS(N, _));
52     }
53
54 #undef N
55 #endif // defined(BOOST_PP_IS_ITERATING)
56