This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: std::vector::insert => strong excepption guarantee?
On Sat, 2004-05-29 at 17:20, Paolo Carlini wrote:
> Paolo Carlini wrote:
>
> > Sorry, probably I'm wrong: I have to study in better detail what
> > happens in those
> > try/catch blocks.
>
> Well, Josuttis
I don't have that book ;-(
> , 5.11.2 and then 6.10.10, is a *very* interesting reading
> about this
> subject, it says, about vector::insert:
>
> "Either succeeds or has no effect if copying/assigning elements
^^^^^^^^^^^^^^^^^^^^^^^^^^
> doesn't throw"
^^^^^^^^^^^^^^^^
But, it may.
> Indeed, the SGI/HP code appear to conform to this requirement, which is
> not really
> the strong guarantee.
Even I think so. However, the strong guarantee would be when the copy
ctor and assignment are allowed to throw, and still the code behaves as
if nothing has happened? Am I right on this count?
--
-Dhruv Matani.
http://www.geocities.com/dhruvbird/
Proud to be a Vegetarian.
http://www.vegetarianstarterkit.com/
http://www.vegkids.com/vegkids/index.html