This is the mail archive of the
libstdc++@sources.redhat.com
mailing list for the libstdc++ project.
Re: [PATCH] fixing libstdc++/737: Regression with maps
- To: Theodore Papadopoulo <Theodore dot Papadopoulo at sophia dot inria dot fr>
- Subject: Re: [PATCH] fixing libstdc++/737: Regression with maps
- From: Brad Garcia <bgarcia at laurelnetworks dot com>
- Date: Tue, 7 Nov 2000 15:53:14 -0500 (EST)
- cc: libstdc++ at sources dot redhat dot com
On Tue, 7 Nov 2000, Theodore Papadopoulo wrote:
> The problem is that that patch only allowed for the comparisons
> (rb_tree::iterator,rb_tree::iterator) whereas the example above
> requires comparisons (rb_tree::const_iterator,rb_tree::iterator).
Good catch!
> I believe it is the best solution unless more such special
> cases have to be added (see PATCH below).
I think this should be the only special case. Think of iterator
comparison as being similar to pointer comparison:
You are not allowed to compare two pointers of different types.
However, you can compare const and non-const pointers of the same type.
The problem with iterators is that the "const" version is a distinct
class from the "non-const" version. Thus your special case was needed.
Brad Garcia