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