From: Peter C. Chapin on
On 2010-07-19 15:51, Daniel Kr�gler wrote:

>>> � if an exception is thrown by an insert() function while
>>> inserting a single element, that function has no effects.
>>
>> ... and what if we are inserting more than one element? what effect(s)
>> we are going to have?
>
> The above quoted wording was intentionally restricted to the
> "one-element" insertion, so this is not incomplete. It was
> decided that a type satisfying a container type is not required
> to ensure the strong exception guarantee for multiple
> element insertions. User-provided container types can easily
> strengthen this requirement, if necessary.

The standard explains what happens if an exception is thrown during a
single element insertion, but appears to be silent about the multiple
element case (true?). Okay, so inserting multiple elements does not
provide the strong guarantee, but what sort of guarantee does it
provide? Is the result UB? Is an implementation permitted to reformat my
hard drive in that case?

Peter


--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]