This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[v3] One additional tweak to forward_list
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 16 Oct 2008 16:05:40 +0200
- Subject: [v3] One additional tweak to forward_list
Hi,
... the last one for now. Tested x86_64-linux, committed to mainline.
Paolo.
//////////////////
2008-10-16 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/forward_list.tcc (operator==): Use auto.
Index: include/bits/forward_list.tcc
===================================================================
*** include/bits/forward_list.tcc (revision 141170)
--- include/bits/forward_list.tcc (working copy)
*************** _GLIBCXX_BEGIN_NAMESPACE(std)
*** 469,475 ****
iterator __first = begin();
iterator __last = end();
if (__first == __last)
! return;
iterator __next = __first;
while (++__next != __last)
{
--- 469,475 ----
iterator __first = begin();
iterator __last = end();
if (__first == __last)
! return;
iterator __next = __first;
while (++__next != __last)
{
*************** _GLIBCXX_BEGIN_NAMESPACE(std)
*** 518,527 ****
{
// We don't have size() so we need to walk through both lists
// making sure both iterators are valid.
! typename std::forward_list<_Tp, _Alloc>::const_iterator __ix
! = __lx.cbegin();
! typename std::forward_list<_Tp, _Alloc>::const_iterator __iy
! = __ly.cbegin();
while (__ix != __lx.cend() && __iy != __ly.cend())
{
if (*__ix != *__iy)
--- 518,525 ----
{
// We don't have size() so we need to walk through both lists
// making sure both iterators are valid.
! auto __ix = __lx.cbegin();
! auto __iy = __ly.cbegin();
while (__ix != __lx.cend() && __iy != __ly.cend())
{
if (*__ix != *__iy)