From 9d377fd443d942e5008fce394285b8d9e2e5f385 Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Mon, 30 Apr 2001 17:48:41 +0000 Subject: [PATCH] stl_iterator_base_funcs.h (__advance): Fix. 2001-04-30 Benjamin Kosnik libstdc++/2964 * include/bits/stl_iterator_base_funcs.h (__advance): Fix. From-SVN: r41690 --- libstdc++-v3/include/bits/stl_iterator_base_funcs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/bits/stl_iterator_base_funcs.h b/libstdc++-v3/include/bits/stl_iterator_base_funcs.h index 5288eda03f1..8520e9da611 100644 --- a/libstdc++-v3/include/bits/stl_iterator_base_funcs.h +++ b/libstdc++-v3/include/bits/stl_iterator_base_funcs.h @@ -107,7 +107,7 @@ distance(_InputIterator __first, _InputIterator __last) } template -inline void __advance(_InputIter& __i, _Distance __n, input_iterator_tag) +inline void __advance_InputIter& __i, _Distance __n, input_iterator_tag) { // concept requirements __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); @@ -120,7 +120,7 @@ inline void __advance(_BidirectionalIterator& __i, _Distance __n, { // concept requirements __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIterator>); - if (__n >= 0) + if (__n > 0) while (__n--) ++__i; else while (__n++) --__i; -- 2.30.2