File indexing completed on 2025-01-18 09:31:07
0001
0002
0003
0004
0005
0006
0007 #if !defined(BOOST_FUSION_BUILD_CONS_10172012_0130)
0008 #define BOOST_FUSION_BUILD_CONS_10172012_0130
0009
0010 #include <boost/tuple/tuple.hpp>
0011 #include <boost/fusion/iterator/equal_to.hpp>
0012 #include <boost/fusion/iterator/next.hpp>
0013 #include <boost/fusion/iterator/value_of.hpp>
0014 #include <boost/fusion/iterator/deref.hpp>
0015
0016 namespace boost { namespace fusion { namespace detail
0017 {
0018 template <
0019 typename First
0020 , typename Last
0021 , bool is_empty = result_of::equal_to<First, Last>::value>
0022 struct build_tuple_cons;
0023
0024 template <typename First, typename Last>
0025 struct build_tuple_cons<First, Last, true>
0026 {
0027 typedef boost::tuples::null_type type;
0028
0029 BOOST_FUSION_GPU_ENABLED
0030 static type
0031 call(First const&, Last const&)
0032 {
0033 return type();
0034 }
0035 };
0036
0037 template <typename First, typename Last>
0038 struct build_tuple_cons<First, Last, false>
0039 {
0040 typedef
0041 build_tuple_cons<typename result_of::next<First>::type, Last>
0042 next_build_tuple_cons;
0043
0044 typedef boost::tuples::cons<
0045 typename result_of::value_of<First>::type
0046 , typename next_build_tuple_cons::type>
0047 type;
0048
0049 BOOST_FUSION_GPU_ENABLED
0050 static type
0051 call(First const& f, Last const& l)
0052 {
0053 typename result_of::value_of<First>::type v = *f;
0054 return type(v, next_build_tuple_cons::call(fusion::next(f), l));
0055 }
0056 };
0057 }}}
0058
0059 #endif