Title
vector::insert(s) exception safety
Status
cd1
Section
[vector.modifiers]
Submitter
Dave Abrahams

Created on 2003-04-27.00:00:00 last changed 171 months ago

Messages

Date: 2010-10-21.18:28:33

[ We probably need to say something similar for deque. ]

Date: 2010-10-21.18:28:33

Proposed resolution:

Replace [vector.modifiers] paragraph 1 with:

1- Notes: Causes reallocation if the new size is greater than the old capacity. If no reallocation happens, all the iterators and references before the insertion point remain valid. If an exception is thrown other than by the copy constructor or assignment operator of T or by any InputIterator operation there are no effects.

Date: 2003-04-27.00:00:00

There is a possible defect in the standard: the standard text was never intended to prevent arbitrary ForwardIterators, whose operations may throw exceptions, from being passed, and it also wasn't intended to require a temporary buffer in the case where ForwardIterators were passed (and I think most implementations don't use one). As is, the standard appears to impose requirements that aren't met by any existing implementation.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg2511
2010-10-21 18:28:33adminsetmessages: + msg2510
2003-04-27 00:00:00admincreate