1 /*=============================================================================
2 Copyright (c) 2001-2006 Joel de Guzman
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
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>
17 namespace boost { namespace fusion
25 #define BOOST_FUSION_AS_FUSION_ELEMENT(z, n, data) \
26 typename detail::as_fusion_element<BOOST_PP_CAT(T, n)>::type
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()
32 #undef BOOST_FUSION_AS_FUSION_ELEMENT
37 #else // defined(BOOST_PP_IS_ITERATING)
38 ///////////////////////////////////////////////////////////////////////////////
40 // Preprocessor vertical repetition code
42 ///////////////////////////////////////////////////////////////////////////////
44 #define N BOOST_PP_ITERATION()
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& _))
50 return tuple<BOOST_PP_ENUM(N, BOOST_FUSION_AS_FUSION_ELEMENT, _)>(
51 BOOST_PP_ENUM_PARAMS(N, _));
55 #endif // defined(BOOST_PP_IS_ITERATING)