diff --git a/include/boost/fusion/algorithm/transformation/pop_back.hpp b/include/boost/fusion/algorithm/transformation/pop_back.hpp index 37f64326..29de95b3 100644 --- a/include/boost/fusion/algorithm/transformation/pop_back.hpp +++ b/include/boost/fusion/algorithm/transformation/pop_back.hpp @@ -78,6 +78,51 @@ namespace boost { namespace fusion , mpl::int_<(Last::is_last?1:0)> >::type {}; + + + template + struct prior_impl + { + typedef typename Iterator::iterator_base_type base_type; + + typedef typename + result_of::prior::type + base_prior; + + typedef pop_back_iterator type; + + static type + call(Iterator const& i) + { + return type(fusion::prior(i.iterator_base)); + } + }; + + template + struct prior_impl + { + // If this is the last iterator, we'll have to double back + typedef typename Iterator::iterator_base_type base_type; + + typedef typename + result_of::prior< + typename result_of::prior::type + >::type + base_prior; + + typedef pop_back_iterator type; + + static type + call(Iterator const& i) + { + return type(fusion::prior( + fusion::prior(i.iterator_base))); + } + }; + + template + struct prior : prior_impl + {}; }; namespace result_of