diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-07-06 12:27:01 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-05-04 05:21:30 +0000 |
commit | 5eae0ce8008ec4d8641ffdc5eeb221a3da0abfc9 (patch) | |
tree | bbd99550b837989bfc4cd462548e75e6f0b7461a /src/corelib/tools/qdoublescanprint_p.h | |
parent | f3af7fce4a9174fb80de22cf650435516c2f3796 (diff) |
QScoped(Array)Pointer: canonicalize swapping
This includes:
- have nothrow member-swap
- have ADL non-member swap
- not specialize qSwap or std::swap
Also prevent QScopedPointer <-> QScopedArrayPointer swaps by overloading
swap (both member and non-member) on QScopedArrayPointer. It's not 100%
safe, but it's what we're doing elsewhere (QMulti(Map,Hash), say).
That's technically a SiC change if users expected (qualified) std::swap
to invoke QScopedPointer::swap(), but those users were doing it wrong to
begin with, and they now get a compile-error instead of silent pessimization,
because generic std::swap() doesn't work on QScopedPointer, due to lack
of copy (and thus move) semantics.
Change-Id: I3ab5c1668722a2c8ccafc16f57310ce8d4bffbd6
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/tools/qdoublescanprint_p.h')
0 files changed, 0 insertions, 0 deletions