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]

Re: [PATCH] Fix PR libstdc++/13462 std::set's pointer is not right


I prefer the change be

+ typedef typename _Alloc::pointer pointer;

To rflect Standard wording. Same for the rest.

With those changes, the patch is OK.


Here is the updated patch (I have not checked it in because there are more
changes I saw that needed to be done like reference was wrong, just like how
pointer was wrong).


OK?

ChangeLog:

ChangeLog:
	* include/bits/stl_multiset.h (__gnu_norm::multiset): Define pointer
	as allocator's pointer, likewise for reference, const_pointer, and
	const_reference.
	* include/bits/stl_set.h (__gnu_norm::set): Likewise.
	* include/ext/hash_set (__gnu_ext::hash_set): Likewise.
	(__gnu_ext::hash_multiset): Likewise.


Index: include/bits/stl_multiset.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/stl_multiset.h,v
retrieving revision 1.16
diff -c -3 -p -r1.16 stl_multiset.h
*** include/bits/stl_multiset.h 11 Nov 2003 20:09:08 -0000 1.16
--- include/bits/stl_multiset.h 22 Dec 2003 18:47:41 -0000
*************** private:
*** 100,109 ****
_Identity<value_type>, key_compare, _Alloc> _Rep_type;
_Rep_type _M_t; // red-black tree representing multiset
public:
! typedef typename _Rep_type::const_pointer pointer;
! typedef typename _Rep_type::const_pointer const_pointer;
! typedef typename _Rep_type::const_reference reference;
! typedef typename _Rep_type::const_reference const_reference;
typedef typename _Rep_type::const_iterator iterator;
typedef typename _Rep_type::const_iterator const_iterator;
typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
--- 100,109 ----
_Identity<value_type>, key_compare, _Alloc> _Rep_type;
_Rep_type _M_t; // red-black tree representing multiset
public:
! typedef typename _Alloc::pointer pointer;
! typedef typename _Alloc::const_pointer const_pointer;
! typedef typename _Alloc::reference reference;
! typedef typename _Alloc::const_reference const_reference;
typedef typename _Rep_type::const_iterator iterator;
typedef typename _Rep_type::const_iterator const_iterator;
typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
Index: include/bits/stl_set.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/stl_set.h,v
retrieving revision 1.16
diff -c -3 -p -r1.16 stl_set.h
*** include/bits/stl_set.h 11 Nov 2003 20:09:08 -0000 1.16
--- include/bits/stl_set.h 22 Dec 2003 18:47:41 -0000
*************** private:
*** 98,107 ****
_Identity<value_type>, key_compare, _Alloc> _Rep_type;
_Rep_type _M_t; // red-black tree representing set
public:
! typedef typename _Rep_type::const_pointer pointer;
! typedef typename _Rep_type::const_pointer const_pointer;
! typedef typename _Rep_type::const_reference reference;
! typedef typename _Rep_type::const_reference const_reference;
typedef typename _Rep_type::const_iterator iterator;
typedef typename _Rep_type::const_iterator const_iterator;
typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
--- 98,107 ----
_Identity<value_type>, key_compare, _Alloc> _Rep_type;
_Rep_type _M_t; // red-black tree representing set
public:
! typedef typename _Alloc::pointer pointer;
! typedef typename _Alloc::const_pointer const_pointer;
! typedef typename _Alloc::reference reference;
! typedef typename _Alloc::const_reference const_reference;
typedef typename _Rep_type::const_iterator iterator;
typedef typename _Rep_type::const_iterator const_iterator;
typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
Index: include/ext/hash_set
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/ext/hash_set,v
retrieving revision 1.16
diff -c -3 -p -r1.16 hash_set
*** include/ext/hash_set 9 Dec 2003 04:31:53 -0000 1.16
--- include/ext/hash_set 22 Dec 2003 18:47:41 -0000
*************** public:
*** 110,119 ****


    typedef typename _Ht::size_type size_type;
    typedef typename _Ht::difference_type difference_type;
!   typedef typename _Ht::const_pointer pointer;
!   typedef typename _Ht::const_pointer const_pointer;
!   typedef typename _Ht::const_reference reference;
!   typedef typename _Ht::const_reference const_reference;

    typedef typename _Ht::const_iterator iterator;
    typedef typename _Ht::const_iterator const_iterator;
--- 110,119 ----

    typedef typename _Ht::size_type size_type;
    typedef typename _Ht::difference_type difference_type;
!   typedef typename _Alloc::pointer pointer;
!   typedef typename _Alloc::const_pointer const_pointer;
!   typedef typename _Alloc::reference reference;
!   typedef typename _Alloc::const_reference const_reference;

    typedef typename _Ht::const_iterator iterator;
    typedef typename _Ht::const_iterator const_iterator;
*************** public:
*** 266,275 ****

    typedef typename _Ht::size_type size_type;
    typedef typename _Ht::difference_type difference_type;
!   typedef typename _Ht::const_pointer pointer;
!   typedef typename _Ht::const_pointer const_pointer;
!   typedef typename _Ht::const_reference reference;
!   typedef typename _Ht::const_reference const_reference;

    typedef typename _Ht::const_iterator iterator;
    typedef typename _Ht::const_iterator const_iterator;
--- 266,275 ----

    typedef typename _Ht::size_type size_type;
    typedef typename _Ht::difference_type difference_type;
!   typedef typename _Alloc::pointer pointer;
!   typedef typename _Alloc:const_pointer const_pointer;
!   typedef typename _Alloc::reference reference;
!   typedef typename _Alloc::const_reference const_reference;

    typedef typename _Ht::const_iterator iterator;
    typedef typename _Ht::const_iterator const_iterator;


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