Commit 9d377fd4 by Benjamin Kosnik

stl_iterator_base_funcs.h (__advance): Fix.


2001-04-30  Benjamin Kosnik  <bkoz@redhat.com>

	libstdc++/2964
	* include/bits/stl_iterator_base_funcs.h (__advance): Fix.

From-SVN: r41690
parent 215e9863
......@@ -107,7 +107,7 @@ distance(_InputIterator __first, _InputIterator __last)
}
template <class _InputIter, class _Distance>
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment