GCC 3.1 Release

Gabriel Dos Reis gdr@codesourcery.com
Mon Apr 15 17:50:00 GMT 2002


Mark Mitchell <mark@codesourcery.com> writes:

[...]

| I think your patch makes sense.  Benjamin what do you think?
| 
| Gaby, if we can do something like this, it will definitely make things
| easier for users.  The standard specifies that std::rel_ops exists, and
| it also specifies that iterators have an operator==, and it certainly
| makes sense to make those two things work together if at all possible.


Mark,

  Here is a patch to move the __normal_iterator<> bits into
__gnu_cxx:: along with the patch suggested by Joe.  It also
incorporates Paolo's test.  Bootstrapped and tested on
i686-pc-linux-gnu (3.1 branch).

I'll apply the same thing to mainline.  Branch requires your approval
if I understand correctly.

-- Gaby

Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/ChangeLog,v
retrieving revision 1.1057.2.73
diff -p -r1.1057.2.73 ChangeLog
*** ChangeLog	15 Apr 2002 20:35:46 -0000	1.1057.2.73
--- ChangeLog	16 Apr 2002 00:42:15 -0000
***************
*** 1,3 ****
--- 1,19 ----
+ 2002-04-16  Paolo Carlini <pcarlini@unitus.it>
+ 	* testsuite/24_iterators/rel_ops.cc: New test.
+ 	
+ 2002-04-16  Gabriel Dos Reis  <gdr@merlin.codesourcery.com>
+ 
+ 	* include/bits/type_traits.h (__normal_iterator): Declare in
+ 	__gnu_cxx.  Adjust use at global namespace.
+ 	* include/bits/stl_iterator.h (__normal_iterator): Move definition
+ 	into __gnu_cxx::. Add more operator overloads.  Tidy existing ones.
+ 	* include/bits/basic_string.h (basic_string): Adjust use of
+ 	__normal_iterator.
+ 	* include/bits/stl_vector.h (_Alloc>): Likewise.
+ 	* src/concept-inst.cc (__gnu_cxx): __normal_iterator<> is now here.
+ 	* src/locale-inst.cc (__gnu_cxx): Likewise.
+ 	* src/string-inst.cc (operator==): Instantiate in __gnu_cxx.
+ 
  2002-04-15  Steve Ellcey  <sje@cup.hp.com>
  
  	* gcc/libstdc++-v3/config/os/hpux/bits/os_defines.h
Index: include/bits/basic_string.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/basic_string.h,v
retrieving revision 1.19.2.2
diff -p -r1.19.2.2 basic_string.h
*** include/bits/basic_string.h	1 Apr 2002 18:56:28 -0000	1.19.2.2
--- include/bits/basic_string.h	16 Apr 2002 00:42:16 -0000
*************** namespace std
*** 99,106 ****
        typedef typename _Alloc::const_reference 		    const_reference;
        typedef typename _Alloc::pointer 			    pointer;
        typedef typename _Alloc::const_pointer 	   	    const_pointer;
!       typedef __normal_iterator<pointer, basic_string> 	    iterator;
!       typedef __normal_iterator<const_pointer, basic_string> const_iterator;
        typedef reverse_iterator<const_iterator> 	const_reverse_iterator;
        typedef reverse_iterator<iterator> 		    reverse_iterator;
      
--- 99,107 ----
        typedef typename _Alloc::const_reference 		    const_reference;
        typedef typename _Alloc::pointer 			    pointer;
        typedef typename _Alloc::const_pointer 	   	    const_pointer;
!       typedef __gnu_cxx::__normal_iterator<pointer, basic_string>  iterator;
!       typedef __gnu_cxx::__normal_iterator<const_pointer, basic_string>
!                                                             const_iterator;
        typedef reverse_iterator<const_iterator> 	const_reverse_iterator;
        typedef reverse_iterator<iterator> 		    reverse_iterator;
      
Index: include/bits/stl_iterator.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/stl_iterator.h,v
retrieving revision 1.19
diff -p -r1.19 stl_iterator.h
*** include/bits/stl_iterator.h	8 Feb 2002 07:34:54 -0000	1.19
--- include/bits/stl_iterator.h	16 Apr 2002 00:42:16 -0000
*************** namespace std
*** 548,554 ****
        return insert_iterator<_Container>(__x, 
  					 typename _Container::iterator(__i));
      }
!   
    // This iterator adapter is 'normal' in the sense that it does not
    // change the semantics of any of the operators of its iterator
    // parameter.  Its primary purpose is to convert an iterator that is
--- 548,557 ----
        return insert_iterator<_Container>(__x, 
  					 typename _Container::iterator(__i));
      }
! } // namespace std
! 
! namespace __gnu_cxx
! {  
    // This iterator adapter is 'normal' in the sense that it does not
    // change the semantics of any of the operators of its iterator
    // parameter.  Its primary purpose is to convert an iterator that is
*************** namespace std
*** 556,561 ****
--- 559,566 ----
    // The _Container parameter exists solely so that different containers
    // using this template can instantiate different types, even if the
    // _Iterator parameter is the same.
+   using std::iterator_traits;
+   using std::iterator;
    template<typename _Iterator, typename _Container>
      class __normal_iterator
        : public iterator<typename iterator_traits<_Iterator>::iterator_category,
*************** namespace std
*** 632,637 ****
--- 637,650 ----
        base() const { return _M_current; }
      };
  
+   // Note: In what follows, the left- and right-hand-side iterators are
+   // allowed to vary in types (conceptually in cv-qualification) so that
+   // comparaison between cv-qualified and non-cv-qualified iterators be
+   // valid.  However, the greedy and unfriendly operators in std::rel_ops
+   // will make overload resolution ambiguous (when in scope) if we don't
+   // provide overloads whose operands are of the same type.  Can someone
+   // remind me what generic programming is about? -- Gaby
+   
    // Forward iterator requirements
    template<typename _IteratorL, typename _IteratorR, typename _Container>
    inline bool
*************** namespace std
*** 639,649 ****
  	     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>
--- 652,674 ----
  	     const __normal_iterator<_IteratorR, _Container>& __rhs)
    { return __lhs.base() == __rhs.base(); }
  
+   template<typename _Iterator, typename _Container>
+   inline bool
+   operator==(const __normal_iterator<_Iterator, _Container>& __lhs,
+              const __normal_iterator<_Iterator, _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.base() != __rhs.base(); }
! 
!   template<typename _Iterator, typename _Container>
!   inline bool
!   operator!=(const __normal_iterator<_Iterator, _Container>& __lhs,
!              const __normal_iterator<_Iterator, _Container>& __rhs)
!   { return __lhs.base() != __rhs.base(); }
  
    // Random access iterator requirements
    template<typename _IteratorL, typename _IteratorR, typename _Container>
*************** namespace std
*** 652,681 ****
  	    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>
    inline __normal_iterator<_Iterator, _Container>
    operator+(typename __normal_iterator<_Iterator, _Container>::difference_type __n,
  	    const __normal_iterator<_Iterator, _Container>& __i)
    { return __normal_iterator<_Iterator, _Container>(__i.base() + __n); }
! } // namespace std
  
  #endif 
  
--- 677,730 ----
  	    const __normal_iterator<_IteratorR, _Container>& __rhs)
    { return __lhs.base() < __rhs.base(); }
  
+   template<typename _Iterator, typename _Container>
+   inline bool
+   operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
+              const __normal_iterator<_Iterator, _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.base() > __rhs.base(); }
! 
!   template<typename _Iterator, typename _Container>
!   inline bool
!   operator>(const __normal_iterator<_Iterator, _Container>& __lhs,
! 	    const __normal_iterator<_Iterator, _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.base() <= __rhs.base(); }
! 
!   template<typename _Iterator, typename _Container>
!   inline bool
!   operator<=(const __normal_iterator<_Iterator, _Container>& __lhs,
! 	     const __normal_iterator<_Iterator, _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.base() >= __rhs.base(); }
! 
!   template<typename _Iterator, typename _Container>
!   inline bool
!   operator>=(const __normal_iterator<_Iterator, _Container>& __lhs,
! 	     const __normal_iterator<_Iterator, _Container>& __rhs)
!   { return __lhs.base() >= __rhs.base(); }
  
    template<typename _Iterator, typename _Container>
    inline __normal_iterator<_Iterator, _Container>
    operator+(typename __normal_iterator<_Iterator, _Container>::difference_type __n,
  	    const __normal_iterator<_Iterator, _Container>& __i)
    { return __normal_iterator<_Iterator, _Container>(__i.base() + __n); }
! } // namespace __gnu_cxx
  
  #endif 
  
Index: include/bits/stl_vector.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/stl_vector.h,v
retrieving revision 1.17.2.2
diff -p -r1.17.2.2 stl_vector.h
*** include/bits/stl_vector.h	27 Mar 2002 21:54:38 -0000	1.17.2.2
--- include/bits/stl_vector.h	16 Apr 2002 00:42:17 -0000
*************** public:
*** 175,182 ****
    typedef _Tp 						value_type;
    typedef value_type* 					pointer;
    typedef const value_type* 				const_pointer;
!   typedef __normal_iterator<pointer, vector_type> 	iterator;
!   typedef __normal_iterator<const_pointer, vector_type> const_iterator;
    typedef value_type& 					reference;
    typedef const value_type& 				const_reference;
    typedef size_t 					size_type;
--- 175,183 ----
    typedef _Tp 						value_type;
    typedef value_type* 					pointer;
    typedef const value_type* 				const_pointer;
!   typedef __gnu_cxx::__normal_iterator<pointer, vector_type> 	iterator;
!   typedef __gnu_cxx::__normal_iterator<const_pointer, vector_type>
!                                                         const_iterator;
    typedef value_type& 					reference;
    typedef const value_type& 				const_reference;
    typedef size_t 					size_type;
Index: include/bits/type_traits.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/type_traits.h,v
retrieving revision 1.11
diff -p -r1.11 type_traits.h
*** include/bits/type_traits.h	2 Nov 2001 22:31:02 -0000	1.11
--- include/bits/type_traits.h	16 Apr 2002 00:42:17 -0000
*************** template<typename _Tp> struct _Is_normal
*** 322,334 ****
  };
  
  // Forward declaration hack, should really include this from somewhere.
! namespace std 
  {
    template<typename _Iterator, typename _Container> class __normal_iterator;
  }
  
  template<typename _Iterator, typename _Container>
! struct _Is_normal_iterator< std::__normal_iterator<_Iterator, _Container> > {
     typedef __true_type _Normal;
  };
  
--- 322,334 ----
  };
  
  // Forward declaration hack, should really include this from somewhere.
! namespace __gnu_cxx
  {
    template<typename _Iterator, typename _Container> class __normal_iterator;
  }
  
  template<typename _Iterator, typename _Container>
! struct _Is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator, _Container> > {
     typedef __true_type _Normal;
  };
  
Index: src/concept-inst.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/concept-inst.cc,v
retrieving revision 1.3
diff -p -r1.3 concept-inst.cc
*** src/concept-inst.cc	4 Jan 2002 21:27:35 -0000	1.3
--- src/concept-inst.cc	16 Apr 2002 00:42:17 -0000
*************** namespace __gnu_cxx
*** 50,60 ****
    template void __aux_require_boolean_expr<bool>(bool const&);
  
    _Instantiate(_BidirectionalIteratorConcept<
!     std::__normal_iterator< std::locale::facet**,
      std::vector<std::locale::facet*,std::allocator<std::locale::facet*> > > > );
  
    _Instantiate(_BidirectionalIteratorConcept<
!     std::__normal_iterator< unsigned*,
      std::vector<unsigned, std::allocator<unsigned> > > > );
  
    _Instantiate(_ConvertibleConcept<std::locale::facet*, std::locale::facet*> );
--- 50,60 ----
    template void __aux_require_boolean_expr<bool>(bool const&);
  
    _Instantiate(_BidirectionalIteratorConcept<
!     __normal_iterator< std::locale::facet**,
      std::vector<std::locale::facet*,std::allocator<std::locale::facet*> > > > );
  
    _Instantiate(_BidirectionalIteratorConcept<
!     __normal_iterator< unsigned*,
      std::vector<unsigned, std::allocator<unsigned> > > > );
  
    _Instantiate(_ConvertibleConcept<std::locale::facet*, std::locale::facet*> );
*************** namespace __gnu_cxx
*** 68,82 ****
    _Instantiate(_InputIteratorConcept<std::locale::facet**> );
  
    _Instantiate(_InputIteratorConcept<
!     std::__normal_iterator< std::locale::facet* const*,
      std::vector<std::locale::facet*,std::allocator<std::locale::facet*> > > > );
  
    _Instantiate(_InputIteratorConcept<
!     std::__normal_iterator< std::locale::facet**,
      std::vector<std::locale::facet*,std::allocator<std::locale::facet*> > > > );
  
    _Instantiate(_InputIteratorConcept<
!     std::__normal_iterator< unsigned*,
      std::vector<unsigned, std::allocator<unsigned> > > > );
  
  #ifdef _GLIBCPP_USE_WCHAR_T
--- 68,82 ----
    _Instantiate(_InputIteratorConcept<std::locale::facet**> );
  
    _Instantiate(_InputIteratorConcept<
!     __normal_iterator< std::locale::facet* const*,
      std::vector<std::locale::facet*,std::allocator<std::locale::facet*> > > > );
  
    _Instantiate(_InputIteratorConcept<
!     __normal_iterator< std::locale::facet**,
      std::vector<std::locale::facet*,std::allocator<std::locale::facet*> > > > );
  
    _Instantiate(_InputIteratorConcept<
!     __normal_iterator< unsigned*,
      std::vector<unsigned, std::allocator<unsigned> > > > );
  
  #ifdef _GLIBCPP_USE_WCHAR_T
*************** namespace __gnu_cxx
*** 98,123 ****
    _Instantiate(_LessThanComparableConcept<unsigned> );
  
    _Instantiate(_Mutable_BidirectionalIteratorConcept<
!     std::__normal_iterator< std::locale::facet**,
      std::vector<std::locale::facet*,std::allocator<std::locale::facet*> > > > );
  
    _Instantiate(_Mutable_BidirectionalIteratorConcept<
!     std::__normal_iterator< unsigned*,
      std::vector<unsigned, std::allocator<unsigned> > > > );
  
    _Instantiate(_Mutable_ForwardIteratorConcept<
!     std::__normal_iterator< std::locale::facet**,
      std::vector<std::locale::facet*,std::allocator<std::locale::facet*> > > > );
  
    _Instantiate(_OutputIteratorConcept<
      std::locale::facet**, std::locale::facet*> );
  
    _Instantiate(_OutputIteratorConcept<
!     std::__normal_iterator< std::locale::facet**,
        std::vector<std::locale::facet*, std::allocator<std::locale::facet* > > >,
      std::locale::facet* > );
  
!   _Instantiate(_OutputIteratorConcept<std::__normal_iterator<
      unsigned*, std::vector<unsigned, std::allocator<unsigned> > >, unsigned> );
  
    _Instantiate(_OutputIteratorConcept<std::ostreambuf_iterator<
--- 98,123 ----
    _Instantiate(_LessThanComparableConcept<unsigned> );
  
    _Instantiate(_Mutable_BidirectionalIteratorConcept<
!     __normal_iterator< std::locale::facet**,
      std::vector<std::locale::facet*,std::allocator<std::locale::facet*> > > > );
  
    _Instantiate(_Mutable_BidirectionalIteratorConcept<
!     __normal_iterator< unsigned*,
      std::vector<unsigned, std::allocator<unsigned> > > > );
  
    _Instantiate(_Mutable_ForwardIteratorConcept<
!     __normal_iterator< std::locale::facet**,
      std::vector<std::locale::facet*,std::allocator<std::locale::facet*> > > > );
  
    _Instantiate(_OutputIteratorConcept<
      std::locale::facet**, std::locale::facet*> );
  
    _Instantiate(_OutputIteratorConcept<
!     __normal_iterator< std::locale::facet**,
        std::vector<std::locale::facet*, std::allocator<std::locale::facet* > > >,
      std::locale::facet* > );
  
!   _Instantiate(_OutputIteratorConcept<__normal_iterator<
      unsigned*, std::vector<unsigned, std::allocator<unsigned> > >, unsigned> );
  
    _Instantiate(_OutputIteratorConcept<std::ostreambuf_iterator<
*************** namespace __gnu_cxx
*** 133,151 ****
    _Instantiate(_RandomAccessIteratorConcept<char const*> );
  
    _Instantiate(_RandomAccessIteratorConcept<
!     std::__normal_iterator<char const*, std::string> > );
  
    _Instantiate(_RandomAccessIteratorConcept<
!     std::__normal_iterator<char*, std::string> > );
  
  #ifdef _GLIBCPP_USE_WCHAR_T
    _Instantiate(_RandomAccessIteratorConcept<
!     std::__normal_iterator<wchar_t const*,
      std::basic_string<wchar_t, std::char_traits<wchar_t>,
                                 std::allocator<wchar_t> > > > );
  
    _Instantiate(_RandomAccessIteratorConcept<
!     std::__normal_iterator<wchar_t*,
      std::basic_string<wchar_t, std::char_traits<wchar_t>,
                                 std::allocator<wchar_t> > > > );
  
--- 133,151 ----
    _Instantiate(_RandomAccessIteratorConcept<char const*> );
  
    _Instantiate(_RandomAccessIteratorConcept<
!     __normal_iterator<char const*, std::string> > );
  
    _Instantiate(_RandomAccessIteratorConcept<
!     __normal_iterator<char*, std::string> > );
  
  #ifdef _GLIBCPP_USE_WCHAR_T
    _Instantiate(_RandomAccessIteratorConcept<
!     __normal_iterator<wchar_t const*,
      std::basic_string<wchar_t, std::char_traits<wchar_t>,
                                 std::allocator<wchar_t> > > > );
  
    _Instantiate(_RandomAccessIteratorConcept<
!     __normal_iterator<wchar_t*,
      std::basic_string<wchar_t, std::char_traits<wchar_t>,
                                 std::allocator<wchar_t> > > > );
  
Index: src/locale-inst.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/locale-inst.cc,v
retrieving revision 1.29.2.2
diff -p -r1.29.2.2 locale-inst.cc
*** src/locale-inst.cc	25 Mar 2002 21:49:09 -0000	1.29.2.2
--- src/locale-inst.cc	16 Apr 2002 00:42:17 -0000
*************** namespace std
*** 410,422 ****
      has_facet<messages<wchar_t> >(const locale&);
  #endif
  
-   // iterator
-   typedef vector<locale::facet*> vec_pfacet;
    template class vector<locale::facet*>;
!   template class __normal_iterator<locale::facet**, vector<locale::facet*> >;
!   template class __normal_iterator<locale::facet* const*,
!                                    vector<locale::facet*> >;
  
    // locale
    template
      char*
--- 410,428 ----
      has_facet<messages<wchar_t> >(const locale&);
  #endif
  
    template class vector<locale::facet*>;
! } // namespace std
! 
! namespace __gnu_cxx
! {
!   // iterator
!   typedef std::vector<std::locale::facet*> vec_pfacet;
!   template class __normal_iterator<std::locale::facet**, vec_pfacet >;
!   template class __normal_iterator<std::locale::facet* const*, vec_pfacet>;
! } // namespace __gnu_cxx
  
+ namespace std
+ {
    // locale
    template
      char*
*************** namespace std
*** 490,495 ****
--- 496,502 ----
      fill_n<locale::facet**, size_t, locale::facet*>
      (locale::facet**, size_t, locale::facet* const&);
  
+   using __gnu_cxx::__normal_iterator;
    template
      __normal_iterator<locale::facet**, vector<locale::facet*> >
      fill_n(__normal_iterator<locale::facet**, vector<locale::facet*> >,
Index: src/string-inst.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/string-inst.cc,v
retrieving revision 1.24
diff -p -r1.24 string-inst.cc
*** src/string-inst.cc	16 Feb 2002 00:19:13 -0000	1.24
--- src/string-inst.cc	16 Apr 2002 00:42:17 -0000
*************** namespace std 
*** 48,56 ****
--- 48,64 ----
    template class basic_string<C>;
    template S operator+(const C*, const S&);
    template S operator+(C, const S&);
+ } // namespace std
+ 
+ namespace __gnu_cxx
+ {
+   using std::S;
    template bool operator==(const S::iterator&, const S::iterator&);
    template bool operator==(const S::const_iterator&, const S::const_iterator&);
+ }
  
+ namespace std
+ {
    // Only one template keyword allowed here. 
    // See core issue #46 (NAD)
    // http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_closed.html#46
Index: testsuite/24_iterators/rel_ops.cc
===================================================================
RCS file: testsuite/24_iterators/rel_ops.cc
diff -N testsuite/24_iterators/rel_ops.cc
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/24_iterators/rel_ops.cc	16 Apr 2002 00:42:17 -0000
***************
*** 0 ****
--- 1,45 ----
+ // 2002-04-13  Paolo Carlini  <pcarlini@unitus.it>
+ 
+ // Copyright (C) 2002 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library.  This library is free
+ // software; you can redistribute it and/or modify it under the
+ // terms of the GNU General Public License as published by the
+ // Free Software Foundation; either version 2, or (at your option)
+ // any later version.
+ 
+ // This library is distributed in the hope that it will be useful,
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ // GNU General Public License for more details.
+ 
+ // You should have received a copy of the GNU General Public License along
+ // with this library; see the file COPYING.  If not, write to the Free
+ // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ // USA.
+ 
+ // 20.2.1 Operators
+ 
+ #include <utility>
+ #include <vector>
+ 
+ using namespace std::rel_ops;
+ 
+ // libstdc++/3628
+ void test01()
+ {
+   std::vector<int> v;
+   std::vector<int>::iterator vi;
+ 
+   vi != v.begin();
+   vi > v.begin();
+   vi <= v.begin();
+   vi >= v.begin();
+ }
+ 
+ int main()
+ {
+   test01();
+   return 0;
+ }
+ 



More information about the Libstdc++ mailing list