Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73692 - trunk/boost/fusion/algorithm/transformation
From: joel_at_[hidden]
Date: 2011-08-12 03:24:00


Author: djowel
Date: 2011-08-12 03:24:00 EDT (Fri, 12 Aug 2011)
New Revision: 73692
URL: http://svn.boost.org/trac/boost/changeset/73692

Log:
revert to prior (again).
Text files modified:
   trunk/boost/fusion/algorithm/transformation/pop_back.hpp | 29 +++++++++++------------------
   1 files changed, 11 insertions(+), 18 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-08-12 03:24:00 EDT (Fri, 12 Aug 2011)
@@ -1,7 +1,7 @@
 /*=============================================================================
- Copyright (c) 2001-2011 Joel de Guzman
+ Copyright (c) 2001-2006 Joel de Guzman
 
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 ==============================================================================*/
 #if !defined(FUSION_POP_BACK_09172005_1038)
@@ -10,9 +10,7 @@
 #include <boost/fusion/view/iterator_range/iterator_range.hpp>
 #include <boost/fusion/sequence/intrinsic/begin.hpp>
 #include <boost/fusion/sequence/intrinsic/end.hpp>
-#include <boost/fusion/sequence/intrinsic/size.hpp>
-#include <boost/fusion/sequence/intrinsic/empty.hpp>
-#include <boost/fusion/iterator/advance.hpp>
+#include <boost/fusion/iterator/prior.hpp>
 
 namespace boost { namespace fusion
 {
@@ -21,14 +19,13 @@
         template <typename Sequence>
         struct pop_back
         {
- static int const size = size<Sequence>::value;
- BOOST_STATIC_ASSERT(size > 0);
- typedef typename begin<Sequence>::type begin_type;
- typedef mpl::int_<size-1> end_index;
- typedef typename advance<begin_type, end_index>::type end_type;
-
- typedef
- iterator_range<begin_type, end_type>
+ typedef
+ iterator_range<
+ typename begin<Sequence>::type
+ , typename prior<
+ typename end<Sequence>::type
+ >::type
+ >
             type;
         };
     }
@@ -37,12 +34,8 @@
     inline typename result_of::pop_back<Sequence const>::type
     pop_back(Sequence const& seq)
     {
- typedef typename
- result_of::pop_back<Sequence const>::end_index
- end_index;
-
         typedef typename result_of::pop_back<Sequence const>::type result;
- return result(fusion::begin(seq), fusion::advance<end_index>(fusion::begin(seq)));
+ return result(fusion::begin(seq), fusion::prior(fusion::end(seq)));
     }
 }}
 


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