Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74870 - trunk/boost/fusion/algorithm/transformation
From: joel_at_[hidden]
Date: 2011-10-09 20:47:40


Author: djowel
Date: 2011-10-09 20:47:40 EDT (Sun, 09 Oct 2011)
New Revision: 74870
URL: http://svn.boost.org/trac/boost/changeset/74870

Log:
Fix for ticket #6000
Text files modified:
   trunk/boost/fusion/algorithm/transformation/pop_back.hpp | 45 ++++++++++++++++++++++++++++++++++++++++
   1 files changed, 45 insertions(+), 0 deletions(-)

Modified: trunk/boost/fusion/algorithm/transformation/pop_back.hpp
==============================================================================
--- trunk/boost/fusion/algorithm/transformation/pop_back.hpp (original)
+++ trunk/boost/fusion/algorithm/transformation/pop_back.hpp 2011-10-09 20:47:40 EDT (Sun, 09 Oct 2011)
@@ -78,6 +78,51 @@
               , mpl::int_<(Last::is_last?1:0)>
>::type
         {};
+
+
+ template <typename Iterator, bool IsLast>
+ struct prior_impl
+ {
+ typedef typename Iterator::iterator_base_type base_type;
+
+ typedef typename
+ result_of::prior<base_type>::type
+ base_prior;
+
+ typedef pop_back_iterator<base_prior, false> type;
+
+ static type
+ call(Iterator const& i)
+ {
+ return type(fusion::prior(i.iterator_base));
+ }
+ };
+
+ template <typename Iterator>
+ struct prior_impl<Iterator, true>
+ {
+ // 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<base_type>::type
+ >::type
+ base_prior;
+
+ typedef pop_back_iterator<base_prior, false> type;
+
+ static type
+ call(Iterator const& i)
+ {
+ return type(fusion::prior(
+ fusion::prior(i.iterator_base)));
+ }
+ };
+
+ template <typename Iterator>
+ struct prior : prior_impl<Iterator, Iterator::is_last>
+ {};
     };
 
     namespace result_of


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk