mirror of
https://github.com/boostorg/utility.git
synced 2025-05-11 05:14:02 +00:00
Merge branch 'develop'
This commit is contained in:
commit
792d0538d2
@ -22,6 +22,8 @@
|
|||||||
#include <boost/type_traits/has_plus_assign.hpp>
|
#include <boost/type_traits/has_plus_assign.hpp>
|
||||||
#include <boost/type_traits/has_minus.hpp>
|
#include <boost/type_traits/has_minus.hpp>
|
||||||
#include <boost/type_traits/has_minus_assign.hpp>
|
#include <boost/type_traits/has_minus_assign.hpp>
|
||||||
|
#include <boost/iterator/advance.hpp>
|
||||||
|
#include <boost/iterator/reverse_iterator.hpp>
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
|
|
||||||
@ -101,7 +103,7 @@ struct next_advance_impl< T, Distance, true >
|
|||||||
{
|
{
|
||||||
static T call(T x, Distance n)
|
static T call(T x, Distance n)
|
||||||
{
|
{
|
||||||
std::advance(x, n);
|
boost::iterators::advance(x, n);
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -147,8 +149,8 @@ struct prior_advance_impl< T, Distance, true >
|
|||||||
static T call(T x, Distance n)
|
static T call(T x, Distance n)
|
||||||
{
|
{
|
||||||
// Avoid negating n to sidestep possible integer overflow
|
// Avoid negating n to sidestep possible integer overflow
|
||||||
std::reverse_iterator< T > rx(x);
|
boost::iterators::reverse_iterator< T > rx(x);
|
||||||
std::advance(rx, n);
|
boost::iterators::advance(rx, n);
|
||||||
return rx.base();
|
return rx.base();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user