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

Andrew Pinski pinskia@physics.uc.edu
Mon Dec 22 16:19:00 GMT 2003


The problem is that std::set's pointer is defined based on 
_Rep_type::const_pointer and not _Rep_type::pointer.
This patch fixes that and others in libstdc++.

OK?


ChangeLog:
	* include/bits/stl_multiset.h (__gnu_norm::multiset::pointer):
	Define based on pointer and not const_pointer.
	* include/bits/stl_set.h (__gnu_norm::set::pointer): Likewise.
	* include/ext/hash_set (__gnu_ext::hash_set::pointer): Likewise.
	(__gnu_ext::hash_multiset::pointer): 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 -u -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 16:13:20 -0000
@@ -100,7 +100,7 @@ private:
                    _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::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;
Index: ./include/bits/stl_set.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/stl_set.h,v
retrieving revision 1.16
diff -u -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 16:13:20 -0000
@@ -98,7 +98,7 @@ private:
                    _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::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;
Index: ./include/ext/hash_set
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/ext/hash_set,v
retrieving revision 1.16
diff -u -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 16:13:21 -0000
@@ -110,7 +110,7 @@ public:

    typedef typename _Ht::size_type size_type;
    typedef typename _Ht::difference_type difference_type;
-  typedef typename _Ht::const_pointer pointer;
+  typedef typename _Ht::pointer pointer;
    typedef typename _Ht::const_pointer const_pointer;
    typedef typename _Ht::const_reference reference;
    typedef typename _Ht::const_reference const_reference;
@@ -266,7 +266,7 @@ public:

    typedef typename _Ht::size_type size_type;
    typedef typename _Ht::difference_type difference_type;
-  typedef typename _Ht::const_pointer pointer;
+  typedef typename _Ht::pointer pointer;
    typedef typename _Ht::const_pointer const_pointer;
    typedef typename _Ht::const_reference reference;
    typedef typename _Ht::const_reference const_reference;



More information about the Libstdc++ mailing list