1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
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(FUSION_BUILD_CONS_09232005_1222)
8 #define FUSION_BUILD_CONS_09232005_1222
10 #include <boost/fusion/support/config.hpp>
11 #include <boost/fusion/container/list/cons.hpp>
12 #include <boost/fusion/iterator/equal_to.hpp>
13 #include <boost/fusion/iterator/next.hpp>
14 #include <boost/fusion/iterator/value_of.hpp>
15 #include <boost/fusion/iterator/deref.hpp>
17 namespace boost { namespace fusion { namespace detail
22 , bool is_empty = result_of::equal_to<First, Last>::value>
25 template <typename First, typename Last>
26 struct build_cons<First, Last, true>
30 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
32 call(First const&, Last const&)
38 template <typename First, typename Last>
39 struct build_cons<First, Last, false>
42 build_cons<typename result_of::next<First>::type, Last>
46 typename result_of::value_of<First>::type
47 , typename next_build_cons::type>
50 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
52 call(First const& f, Last const& l)
54 typename result_of::value_of<First>::type v = *f;
55 return type(v, next_build_cons::call(fusion::next(f), l));