1 /*============================================================================= 2 Copyright (c) 2005-2013 Joel de Guzman 3 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_DEQUE_02032013_1921) 8 #define BOOST_FUSION_BUILD_DEQUE_02032013_1921 9 10 #if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) 11 #error "C++03 only! This file should not have been included" 12 #endif 13 14 #include <boost/fusion/sequence/intrinsic/begin.hpp> 15 #include <boost/fusion/sequence/intrinsic/size.hpp> 16 #include <boost/fusion/container/deque/detail/cpp03/as_deque.hpp> 17 #include <boost/fusion/container/deque/front_extended_deque.hpp> 18 19 namespace boost { namespace fusion 20 { 21 namespace result_of 22 { 23 template <typename Sequence> 24 struct as_deque 25 : detail::as_deque<result_of::size<Sequence>::value> 26 { 27 typedef typename 28 detail::as_deque<result_of::size<Sequence>::value> 29 gen; 30 typedef typename gen:: 31 template apply<typename result_of::begin<Sequence>::type>::type 32 type; 33 }; 34 } 35 36 template <typename Sequence> 37 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED 38 inline typename result_of::as_deque<Sequence>::type as_deque(Sequence & seq)39 as_deque(Sequence& seq) 40 { 41 typedef typename result_of::as_deque<Sequence>::gen gen; 42 return gen::call(fusion::begin(seq)); 43 } 44 45 template <typename Sequence> 46 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED 47 inline typename result_of::as_deque<Sequence const>::type as_deque(Sequence const & seq)48 as_deque(Sequence const& seq) 49 { 50 typedef typename result_of::as_deque<Sequence const>::gen gen; 51 return gen::call(fusion::begin(seq)); 52 } 53 }} 54 55 #endif 56