[PATCH] Fix PR libstdc++/13462 std::set's pointer is not right
Nathan Myers
ncm-nospam@cantrip.org
Mon Dec 22 23:32:00 GMT 2003
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
More information about the Libstdc++
mailing list