/*============================================================================= Copyright (c) 2003 Joel de Guzman Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #if !defined(FUSION_SEQUENCE_DETAIL_GENERATE_HPP) #define FUSION_SEQUENCE_DETAIL_GENERATE_HPP #include #include #include #include #include #include #include #include #include #include #define FUSION_DEREF_ITERATOR(z, n, data) \ typename checked_deref_iterator< \ BOOST_PP_CAT(T, n), Last>::type #define FUSION_NEXT_ITERATOR(z, n, data) \ typedef typename checked_next_iterator< \ BOOST_PP_CAT(T, n), Last>::type \ BOOST_PP_CAT(T, BOOST_PP_INC(n)); namespace boost { namespace fusion { namespace detail { template struct checked_deref_iterator { typedef typename mpl::eval_if< meta::equal_to , mpl::identity , meta::value_of >::type type; }; template struct checked_next_iterator { typedef typename mpl::eval_if< meta::equal_to , mpl::identity , meta::next >::type type; }; template struct result_of_generate { typedef First T0; BOOST_PP_REPEAT( BOOST_PP_DEC(FUSION_MAX_TUPLE_SIZE), FUSION_NEXT_ITERATOR, _) typedef tuple type; }; template inline typename result_of_generate::type generate(First const& first, Last const&) { typedef typename result_of_generate::type result; return result(first); } }}} #undef FUSION_DEREF_ITERATOR #undef FUSION_NEXT_ITERATOR #endif