Merge pull request #116 from jiayuehua/develop

fix range-base gather algorithm
This commit is contained in:
Marshall Clow 2023-06-14 09:23:41 -07:00 committed by GitHub
commit faac048d59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
/* /*
Copyright 2008 Adobe Systems Incorporated Copyright 2008 Adobe Systems Incorporated
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
@ -84,7 +84,7 @@ namespace boost { namespace algorithm {
template < template <
typename BidirectionalIterator, // models BidirectionalIterator typename BidirectionalIterator, // models BidirectionalIterator
typename Pred> // models UnaryPredicate typename Pred> // models UnaryPredicate
std::pair<BidirectionalIterator, BidirectionalIterator> gather std::pair<BidirectionalIterator, BidirectionalIterator> gather
( BidirectionalIterator first, BidirectionalIterator last, BidirectionalIterator pivot, Pred pred ) ( BidirectionalIterator first, BidirectionalIterator last, BidirectionalIterator pivot, Pred pred )
{ {
// The first call partitions everything up to (but not including) the pivot element, // The first call partitions everything up to (but not including) the pivot element,
@ -106,11 +106,11 @@ template <
typename BidirectionalRange, // typename BidirectionalRange, //
typename Pred> // Pred models UnaryPredicate typename Pred> // Pred models UnaryPredicate
std::pair< std::pair<
typename boost::range_iterator<const BidirectionalRange>::type, typename boost::range_iterator<BidirectionalRange>::type,
typename boost::range_iterator<const BidirectionalRange>::type> typename boost::range_iterator<BidirectionalRange>::type>
gather ( gather (
const BidirectionalRange &range, BidirectionalRange &range,
typename boost::range_iterator<const BidirectionalRange>::type pivot, typename boost::range_iterator<BidirectionalRange>::type pivot,
Pred pred ) Pred pred )
{ {
return boost::algorithm::gather ( boost::begin ( range ), boost::end ( range ), pivot, pred ); return boost::algorithm::gather ( boost::begin ( range ), boost::end ( range ), pivot, pred );