This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


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

Re: [PATCH] fixing libstdc++/737: Regression with maps


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



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