From 5bfbfb771646187059438a404318d213525ccfbf Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Mon, 10 Jul 2017 14:51:07 +0300 Subject: [PATCH] Use a separate template parameter for distance in advance(). This follows std::advance interface and also allows to use distance types other than iterator's difference_type (if the iterator supports that). --- include/boost/iterator/advance.hpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/include/boost/iterator/advance.hpp b/include/boost/iterator/advance.hpp index 2698f2b..6f81cdb 100644 --- a/include/boost/iterator/advance.hpp +++ b/include/boost/iterator/advance.hpp @@ -9,17 +9,16 @@ #include #include -#include namespace boost { namespace iterators { namespace detail { - template + template inline BOOST_CXX14_CONSTEXPR void advance_impl( InputIterator& it - , typename iterator_difference::type n + , Distance n , incrementable_traversal_tag ) { @@ -29,11 +28,11 @@ namespace iterators { } } - template + template inline BOOST_CXX14_CONSTEXPR void advance_impl( BidirectionalIterator& it - , typename iterator_difference::type n + , Distance n , bidirectional_traversal_tag ) { @@ -51,11 +50,11 @@ namespace iterators { } } - template + template inline BOOST_CXX14_CONSTEXPR void advance_impl( RandomAccessIterator& it - , typename iterator_difference::type n + , Distance n , random_access_traversal_tag ) { @@ -64,9 +63,9 @@ namespace iterators { } namespace advance_adl_barrier { - template + template inline BOOST_CXX14_CONSTEXPR void - advance(InputIterator& it, typename iterator_difference::type n) + advance(InputIterator& it, Distance n) { detail::advance_impl( it, n, typename iterator_traversal::type()