1 /*============================================================================= 2 Copyright (c) 2001-2011 Joel de Guzman 3 Copyright (c) 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(BOOST_FUSION_PRIOR_IMPL_20060222_1944) 9 #define BOOST_FUSION_PRIOR_IMPL_20060222_1944 10 11 namespace example 12 { 13 struct example_struct_iterator_tag; 14 15 template<typename Struct, int Pos> 16 struct example_struct_iterator; 17 } 18 19 namespace boost { namespace fusion { 20 21 namespace extension 22 { 23 template<typename Tag> 24 struct prior_impl; 25 26 template<> 27 struct prior_impl<example::example_struct_iterator_tag> 28 { 29 template<typename Iterator> 30 struct apply 31 { 32 typedef typename Iterator::struct_type struct_type; 33 typedef typename Iterator::index index; 34 typedef example::example_struct_iterator<struct_type, index::value - 1> type; 35 36 static type callboost::fusion::extension::prior_impl::apply37 call(Iterator const& i) 38 { 39 return type(i.struct_); 40 } 41 }; 42 }; 43 } 44 }} 45 46 #endif 47