diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2013-09-05 16:59:46 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-06 19:58:51 +0200 |
commit | ba43b70132b661d1b8d99af5258fca3567fe776c (patch) | |
tree | de990807d28d805552efe50ca8924d9add90a264 /src/corelib/tools/qvector.h | |
parent | 018c4850c9d8c6a806d40a6a0da14855f071d4fe (diff) |
Compile in strict-iterator mode under MSVC
MSVC doesn't like operator->() returning a pointer to
non-aggregate. So we must make sure that the expanded code does not
try to call it by doing:
abegin->~T();
Instead, we make an implicit call to operator T*() with that
static_cast<T* >. If abegin is a non-strict iterator, it's already
a T*, so the static_cast is a no-op.
qvector.h(645) : error C2839: invalid return type 'int *' for overloaded 'operator ->'
Change-Id: I06f983bab7677cb60ef3913cdce349e26896bfb6
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/tools/qvector.h')
-rw-r--r-- | src/corelib/tools/qvector.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 489ee821b9..4ff2b9f8e0 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -634,7 +634,7 @@ typename QVector<T>::iterator QVector<T>::erase(iterator abegin, iterator aend) iterator moveEnd = d->end(); while (moveBegin != moveEnd) { if (QTypeInfo<T>::isComplex) - abegin->~T(); + static_cast<T *>(abegin)->~T(); new (abegin++) T(*moveBegin++); } if (abegin < d->end()) { |