1 /*=============================================================================
2 Copyright (c) 1999-2003 Jaakko Järvi
3 Copyright (c) 2001-2003 Joel de Guzman
5 Use, modification and distribution is subject to the Boost Software
6 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 http://www.boost.org/LICENSE_1_0.txt)
8 ==============================================================================*/
9 #if !defined(FUSION_SEQUENCE_TIE_HPP)
10 #define FUSION_SEQUENCE_TIE_HPP
12 #include <boost/ref.hpp>
13 #include <boost/preprocessor/repetition/enum.hpp>
14 #include <boost/preprocessor/repetition/enum_params.hpp>
15 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
16 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
17 #include <boost/spirit/fusion/sequence/tuple.hpp>
19 namespace boost
{ namespace fusion
21 // Swallows any assignment (by Doug Gregor)
28 operator=(const T
&) const
35 // "ignore" allows tuple positions to be ignored when using "tie".
36 detail::swallow_assign
const ignore
= detail::swallow_assign();
38 #define FUSION_REFERENCE_TYPE(z, n, data) \
41 #define FUSION_TIE(z, n, _) \
43 template <BOOST_PP_ENUM_PARAMS(n, typename T)> \
44 inline tuple<BOOST_PP_ENUM(n, FUSION_REFERENCE_TYPE, _)> \
45 tie(BOOST_PP_ENUM_BINARY_PARAMS(n, T, & _)) \
47 return tuple<BOOST_PP_ENUM(n, FUSION_REFERENCE_TYPE, _)>( \
48 BOOST_PP_ENUM_PARAMS(n, _)); \
51 BOOST_PP_REPEAT_FROM_TO(1, FUSION_MAX_TUPLE_SIZE
, FUSION_TIE
, _
)
53 #undef FUSION_REFERENCE_TYPE