1 /*=============================================================================
2 Copyright (c) 2012-2014 Kohei Takahashi
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 #if !defined(BOOST_FUSION_BUILD_CONS_10172012_0130)
8 #define BOOST_FUSION_BUILD_CONS_10172012_0130
10 #include <boost/tuple/tuple.hpp>
11 #include <boost/fusion/iterator/equal_to.hpp>
12 #include <boost/fusion/iterator/next.hpp>
13 #include <boost/fusion/iterator/value_of.hpp>
14 #include <boost/fusion/iterator/deref.hpp>
16 namespace boost { namespace fusion { namespace detail
21 , bool is_empty = result_of::equal_to<First, Last>::value>
22 struct build_tuple_cons;
24 template <typename First, typename Last>
25 struct build_tuple_cons<First, Last, true>
27 typedef boost::tuples::null_type type;
29 BOOST_FUSION_GPU_ENABLED
31 call(First const&, Last const&)
37 template <typename First, typename Last>
38 struct build_tuple_cons<First, Last, false>
41 build_tuple_cons<typename result_of::next<First>::type, Last>
42 next_build_tuple_cons;
44 typedef boost::tuples::cons<
45 typename result_of::value_of<First>::type
46 , typename next_build_tuple_cons::type>
49 BOOST_FUSION_GPU_ENABLED
51 call(First const& f, Last const& l)
53 typename result_of::value_of<First>::type v = *f;
54 return type(v, next_build_tuple_cons::call(fusion::next(f), l));