Commit 4681bebd by Paolo Carlini Committed by Paolo Carlini

list.tcc (operator=): Avoid iterator postincrement.

2004-10-07  Paolo Carlini  <pcarlini@suse.de>

	* include/bits/list.tcc (operator=): Avoid iterator postincrement.
	* include/bits/stl_tree.h (erase(iterator, iterator)): Likewise.

From-SVN: r88715
parent d7d086f0
2004-10-07 Paolo Carlini <pcarlini@suse.de>
* include/bits/list.tcc (operator=): Avoid iterator postincrement.
* include/bits/stl_tree.h (erase(iterator, iterator)): Likewise.
2004-10-07 Benjamin Kosnik <bkoz@redhat.com> 2004-10-07 Benjamin Kosnik <bkoz@redhat.com>
* include/tr1: New. * include/tr1: New.
......
...@@ -125,8 +125,9 @@ namespace _GLIBCXX_STD ...@@ -125,8 +125,9 @@ namespace _GLIBCXX_STD
iterator __last1 = end(); iterator __last1 = end();
const_iterator __first2 = __x.begin(); const_iterator __first2 = __x.begin();
const_iterator __last2 = __x.end(); const_iterator __last2 = __x.end();
while (__first1 != __last1 && __first2 != __last2) for (; __first1 != __last1 && __first2 != __last2;
*__first1++ = *__first2++; ++__first1, ++__first2)
*__first1 = *__first2;
if (__first2 == __last2) if (__first2 == __last2)
erase(__first1, __last1); erase(__first1, __last1);
else else
......
...@@ -1087,7 +1087,8 @@ namespace std ...@@ -1087,7 +1087,8 @@ namespace std
if (__first == begin() && __last == end()) if (__first == begin() && __last == end())
clear(); clear();
else else
while (__first != __last) erase(__first++); for (; __first != __last; ++__first)
erase(__first);
} }
template<typename _Key, typename _Val, typename _KeyOfValue, template<typename _Key, typename _Val, typename _KeyOfValue,
......
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