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_TUPLE_TIE_10032005_0846)
9 #define FUSION_TUPLE_TIE_10032005_0846
11 #include <boost/preprocessor/iterate.hpp>
12 #include <boost/preprocessor/cat.hpp>
13 #include <boost/preprocessor/repetition/enum_params.hpp>
14 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
15 #include <boost/fusion/tuple/tuple.hpp>
17 namespace boost { namespace fusion
19 #define BOOST_FUSION_REF(z, n, data) BOOST_PP_CAT(T, n)&
21 #define BOOST_PP_FILENAME_1 <boost/fusion/tuple/tuple_tie.hpp>
22 #define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE)
23 #include BOOST_PP_ITERATE()
25 #undef BOOST_FUSION_REF
30 #else // defined(BOOST_PP_IS_ITERATING)
31 ///////////////////////////////////////////////////////////////////////////////
33 // Preprocessor vertical repetition code
35 ///////////////////////////////////////////////////////////////////////////////
37 #define N BOOST_PP_ITERATION()
39 template <BOOST_PP_ENUM_PARAMS(N, typename T)>
40 inline tuple<BOOST_PP_ENUM(N, BOOST_FUSION_REF, _)>
41 tie(BOOST_PP_ENUM_BINARY_PARAMS(N, T, & _))
43 return tuple<BOOST_PP_ENUM(N, BOOST_FUSION_REF, _)>(
44 BOOST_PP_ENUM_PARAMS(N, _));
48 #endif // defined(BOOST_PP_IS_ITERATING)