qt5base-lts/tests/auto/corelib/tools/qarraydata
João Abecasis 9c04f721a6 QArrayDataOps::insert
Inserting elements anywhere in the array requires moving the elements
that follow out of the way and writing in the new ones. Trivial for PODs
and almost as much for movable types.

For "complex" types, we start by extending the array with placement new
and copy constructing elements. Then, copy assignment resets the
elements that were previously part of the array.

QPodArrayOps uses non-throwing operations. QMovableArrayOps provides
full rollback in the face of exceptions (strong guarantee).
QGenericArrayOps enforces that no data is leaked (all destructors
called) and invariants are maintained on exceptions -- the basic
guarantee.

With 3 different implementations, 2 of which are non-trivial, this
operation is a good showcase for QArrayOpsSelector and the different
implementations. As such, it warrants its own commit.

Change-Id: I21d9b4cb8e810db82623bcd1d78f583ebf3b6cb7
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-14 15:55:47 +01:00
..
qarraydata.pro SimpleVector as a test case for QArrayData 2011-12-07 02:01:42 +01:00
simplevector.h QArrayDataOps::insert 2011-12-14 15:55:47 +01:00
tst_qarraydata.cpp QArrayDataOps::insert 2011-12-14 15:55:47 +01:00