This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Fix PR libstdc++/13462 std::set's pointer is not right
- From: Nathan Myers <ncm-nospam at cantrip dot org>
- To: libstdc++ at gcc dot gnu dot org
- Date: Mon, 22 Dec 2003 09:24:55 -0800
- Subject: Re: [PATCH] Fix PR libstdc++/13462 std::set's pointer is not right
- References: <90AC01C3-349A-11D8-BB55-000393A6D2F2@physics.uc.edu>
On Mon, Dec 22, 2003 at 08:19:06AM -0800, Andrew Pinski wrote:
> 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++.
>
> 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.
I'm not sure this is right. The problem is that the elements of a
std::set<> are supposed to be immutable. Exposing a non-const pointer
to the elements breaks that property.
If somebody has already researched the matter and thought this through,
I apologize for the intrusion.
Nathan Myers
ncm-nospam@cantrip.org