stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Farid Zaripov <>
Subject std::list::insert() exception safety
Date Wed, 31 Jan 2007 16:42:45 GMT

   The list::insert() method do not satisfy strong exception safety 

   The standard says:

=================== list modifiers [list.modifiers]

iterator insert(iterator position, const T& x);

void insert(iterator position, size_type n, const T& x);

template <class InputIterator>
void insert(iterator position, InputIterator first, InputIterator last);

void push_front(const T& x);

void push_back(const T& x);

1 Remarks: Does not affect the validity of iterators and references. If 
an exception is thrown there are no effects.

   Actually this remark is valid only for inserting a single element.

   The simple test is attached.


View raw message