
"Alberto Barbati" <abarbati@iaanus.com> wrote
If there is space, the buffer tries to copy construct an element in an empty (uninitialized) space, then the internal state of the buffer is updated (this operation does not throw). If the copy ctor throws an exception, no object is constructed and the buffer state is not modified => the buffer is in the exact state it was before the call => strong guarantee.
If there is not enough space, the buffer tries to replace one value by invoking operator=, then the internal state is updated (this operation doesn't throw). *If operator= provides the strong guarantee* and throws, the element already in the buffer is not modified and the buffer state is not modified either => the buffer is in the exact state it was before the call => strong guarantee.
It seems to me that this cover all cases and you always get strong guarantee. Am I missing something?
No, you are right here. /Pavel