From 21301c93dc6503a5cb7c26e3077e6ae3c96f597a Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Mon, 10 Oct 2011 00:47:40 +0000 Subject: [PATCH] Fix for ticket #6000 [SVN r74870] --- .../algorithm/transformation/pop_back.hpp | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) 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