This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]