This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch] libstdc++/20787 (DR 130)
- From: Geoffrey Keating <geoffk at geoffk dot org>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: 02 Sep 2005 16:13:44 -0700
- Subject: Re: [Patch] libstdc++/20787 (DR 130)
- References: <431845BB.9010408@suse.de>
Paolo Carlini <pcarlini@suse.de> writes:
> Hi,
>
> a few days ago I noticed that the relevant DR in the meanwhile has been
> moved to [DR] status and decided to reconsider implementing its
> resolution. Indeed, apparently there is a very large consensus (see also
> Effective STL, outside the LWG references proper, f.i.) that changing
> the associative containers consistently with all the other containers is
> a good thing. The only minor disadvantage seems that a single
> erase(iterator) becomes computationally a little more expensive, due to
> the additional iterator increment (however, this is not the case for
> erase(iterator, iterator), because its internal loop can now make use of
> the erase(iterator) return value, i.e., the very same idiom used in
> list::erase).
>
> Anyone disagreeing with adding the below to mainline?!?
Isn't this a binary incompatible change?
> - void
> + iterator
> erase(iterator __position)
> - { _M_t.erase(__position); }
> + { return _M_t.erase(__position); }
It might happen to be OK on some platforms, but I doubt it would be
safe on all.
There are other changes that look unsafe, in fact most of the header
changes.