This is the mail archive of the libstdc++@gcc.gnu.org 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]
Other format: [Raw text]

Re: [Patch] libstdc++/20787 (DR 130)


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.


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