1 /*============================================================================= 2 Copyright (c) 2001-2011 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(FUSION_PRIOR_IMPL_05042005_1145) 8 #define FUSION_PRIOR_IMPL_05042005_1145 9 10 #include <boost/fusion/support/config.hpp> 11 #include <boost/fusion/container/vector/vector_iterator.hpp> 12 13 namespace boost { namespace fusion 14 { 15 struct vector_iterator_tag; 16 template <typename Vector, int N> 17 struct vector_iterator; 18 19 namespace extension 20 { 21 template <typename Tag> 22 struct prior_impl; 23 24 template <> 25 struct prior_impl<vector_iterator_tag> 26 { 27 template <typename Iterator> 28 struct apply 29 { 30 typedef typename Iterator::vector vector; 31 typedef typename Iterator::index index; 32 typedef vector_iterator<vector, index::value-1> type; 33 34 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED 35 static type callboost::fusion::extension::prior_impl::apply36 call(Iterator const& i) 37 { 38 return type(i.vec); 39 } 40 }; 41 }; 42 } 43 }} 44 45 #endif 46