This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


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

Re: Iterator fix


Benjamin Kosnik writes:

 > Can you please re-submit this with a ChangeLog entry, and use diff -cp?
Sorry.  Don't even try to use such stuff.  Hopefully I become better with
time.

The problem was: iterator comparision functions in stl_iterator.h are
not inlined.  Just added an inline from operator== to operator>=.

Thomas

Index: libstdc++-v3/ChangeLog
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/ChangeLog,v
retrieving revision 1.56
diff -c -3 -p -r1.56 ChangeLog
*** ChangeLog	2000/06/03 01:52:32	1.56
--- ChangeLog	2000/06/06 09:32:06
***************
*** 1,3 ****
--- 1,7 ----
+ 2000-06-06  Thomas Holenstein  <thomas@hex.ch>
+ 
+ 	* bits/stl_iterator.h: Added inline to operators == to >=.
+ 
  2000-06-02  Benjamin Kosnik  <bkoz@purist.soma.redhat.com>
  
  	* bits/locale_facets.h: Tweak.
Index: libstdc++-v3/bits/stl_iterator.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/bits/stl_iterator.h,v
retrieving revision 1.2
diff -c -3 -p -r1.2 stl_iterator.h
*** stl_iterator.h	2000/04/25 06:39:48	1.2
--- stl_iterator.h	2000/06/06 09:32:07
*************** public:
*** 1043,1077 ****
  // forward iterator requirements
  
  template<typename _IteratorL, typename _IteratorR, typename _Container>
! bool operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
!                 const __normal_iterator<_IteratorR, _Container>& __rhs)
  { return __lhs.base() == __rhs.base(); }
  
  template<typename _IteratorL, typename _IteratorR, typename _Container>
! bool operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
!                 const __normal_iterator<_IteratorR, _Container>& __rhs)
  { return !(__lhs == __rhs); }
  
  // random access iterator requirements
  
  template<typename _IteratorL, typename _IteratorR, typename _Container>
! bool operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
!                const __normal_iterator<_IteratorR, _Container>& __rhs)
  { return __lhs.base() < __rhs.base(); }
  
  template<typename _IteratorL, typename _IteratorR, typename _Container>
! bool operator>(const __normal_iterator<_IteratorL, _Container>& __lhs,
!                const __normal_iterator<_IteratorR, _Container>& __rhs)
  { return __rhs < __lhs; }
  
  template<typename _IteratorL, typename _IteratorR, typename _Container>
! bool operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
!                 const __normal_iterator<_IteratorR, _Container>& __rhs)
  { return !(__rhs < __lhs); }
  
  template<typename _IteratorL, typename _IteratorR, typename _Container>
! bool operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
!                 const __normal_iterator<_IteratorR, _Container>& __rhs)
  { return !(__lhs < __rhs); }
  
  template<typename _Iterator, typename _Container>
--- 1043,1083 ----
  // forward iterator requirements
  
  template<typename _IteratorL, typename _IteratorR, typename _Container>
! inline bool
! operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
! 	   const __normal_iterator<_IteratorR, _Container>& __rhs)
  { return __lhs.base() == __rhs.base(); }
  
  template<typename _IteratorL, typename _IteratorR, typename _Container>
! inline bool
! operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
! 	   const __normal_iterator<_IteratorR, _Container>& __rhs)
  { return !(__lhs == __rhs); }
  
  // random access iterator requirements
  
  template<typename _IteratorL, typename _IteratorR, typename _Container>
! inline bool 
! operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
! 	  const __normal_iterator<_IteratorR, _Container>& __rhs)
  { return __lhs.base() < __rhs.base(); }
  
  template<typename _IteratorL, typename _IteratorR, typename _Container>
! inline bool
! operator>(const __normal_iterator<_IteratorL, _Container>& __lhs,
! 	  const __normal_iterator<_IteratorR, _Container>& __rhs)
  { return __rhs < __lhs; }
  
  template<typename _IteratorL, typename _IteratorR, typename _Container>
! inline bool
! operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
! 	   const __normal_iterator<_IteratorR, _Container>& __rhs)
  { return !(__rhs < __lhs); }
  
  template<typename _IteratorL, typename _IteratorR, typename _Container>
! inline bool
! operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
! 	   const __normal_iterator<_IteratorR, _Container>& __rhs)
  { return !(__lhs < __rhs); }
  
  template<typename _Iterator, typename _Container>

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