summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qrefcount.h
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2011-11-22 12:16:24 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-14 15:55:47 +0100
commit9c04f721a6b0521f596950771e9d88a5d00a29ee (patch)
treef1a8df435cf1cce1b7bb982137ded0dd45860142 /src/corelib/tools/qrefcount.h
parent4da0b5fc02fe3a647d32892905c42928841d6487 (diff)
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>
Diffstat (limited to 'src/corelib/tools/qrefcount.h')
0 files changed, 0 insertions, 0 deletions