stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Farid Zaripov <Far...@kyiv.vdiweb.com>
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 
requirements.


   The standard says:

===================
23.2.3.3 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.

Farid.


Mime
View raw message