revert to prior (again).

[SVN r73692]
This commit is contained in:
Joel de Guzman
2011-08-12 07:24:00 +00:00
parent faa5746f6d
commit 8b80a11877

View File

@ -1,5 +1,5 @@
/*=============================================================================
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
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -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 @@ namespace boost { namespace fusion
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>
iterator_range<
typename begin<Sequence>::type
, typename prior<
typename end<Sequence>::type
>::type
>
type;
};
}
@ -37,12 +34,8 @@ namespace boost { namespace fusion
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)));
}
}}