1 /*============================================================================= 2 Copyright (c) 2001-2011 Joel de Guzman 3 Copyright (c) 2005-2006 Dan Marsden 4 5 Distributed under the Boost Software License, Version 1.0. (See accompanying 6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 ==============================================================================*/ 8 #if !defined(FUSION_CONVERT_IMPL_09232005_1215) 9 #define FUSION_CONVERT_IMPL_09232005_1215 10 11 #include <boost/fusion/support/config.hpp> 12 #include <boost/fusion/container/list/cons.hpp> 13 #include <boost/fusion/container/list/detail/build_cons.hpp> 14 #include <boost/fusion/sequence/intrinsic/empty.hpp> 15 #include <boost/fusion/sequence/intrinsic/begin.hpp> 16 #include <boost/fusion/sequence/intrinsic/end.hpp> 17 18 namespace boost { namespace fusion 19 { 20 struct cons_tag; 21 22 namespace extension 23 { 24 template <typename T> 25 struct convert_impl; 26 27 template <> 28 struct convert_impl<cons_tag> 29 { 30 template <typename Sequence> 31 struct apply 32 { 33 typedef typename 34 detail::build_cons< 35 typename result_of::begin<Sequence>::type 36 , typename result_of::end<Sequence>::type 37 > 38 build_cons; 39 40 typedef typename build_cons::type type; 41 42 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED 43 static type callboost::fusion::extension::convert_impl::apply44 call(Sequence& seq) 45 { 46 return build_cons::call(fusion::begin(seq), fusion::end(seq)); 47 } 48 }; 49 }; 50 } 51 }} 52 53 #endif 54