diff options
Diffstat (limited to 'src/corelib/tools/qvector.h')
-rw-r--r-- | src/corelib/tools/qvector.h | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 2d12a95b4b..f00cecbc83 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -311,6 +311,7 @@ private: // will be default-initialized # pragma warning ( push ) # pragma warning ( disable : 4345 ) +# pragma warning(disable : 4127) // conditional expression is constant #endif template <typename T> @@ -325,10 +326,6 @@ void QVector<T>::defaultConstruct(T *from, T *to) } } -#ifdef Q_CC_MSVC -# pragma warning ( pop ) -#endif - template <typename T> void QVector<T>::copyConstruct(const T *srcFrom, const T *srcTo, T *dstFrom) { @@ -340,11 +337,6 @@ void QVector<T>::copyConstruct(const T *srcFrom, const T *srcTo, T *dstFrom) } } -#if defined(Q_CC_MSVC) -#pragma warning( push ) -#pragma warning( disable : 4127 ) // conditional expression is constant -#endif - template <typename T> void QVector<T>::destruct(T *from, T *to) { @@ -355,10 +347,6 @@ void QVector<T>::destruct(T *from, T *to) } } -#if defined(Q_CC_MSVC) -#pragma warning( pop ) -#endif - template <typename T> inline QVector<T>::QVector(const QVector<T> &v) { @@ -380,6 +368,10 @@ inline QVector<T>::QVector(const QVector<T> &v) } } +#if defined(Q_CC_MSVC) +#pragma warning( pop ) +#endif + template <typename T> void QVector<T>::detach() { @@ -507,6 +499,11 @@ QVector<T>::QVector(int asize, const T &t) } #ifdef Q_COMPILER_INITIALIZER_LISTS +# if defined(Q_CC_MSVC) +QT_WARNING_PUSH +QT_WARNING_DISABLE_MSVC(4127) // conditional expression is constant +# endif // Q_CC_MSVC + template <typename T> QVector<T>::QVector(std::initializer_list<T> args) { @@ -521,7 +518,10 @@ QVector<T>::QVector(std::initializer_list<T> args) d = Data::sharedNull(); } } -#endif +# if defined(Q_CC_MSVC) +QT_WARNING_POP +# endif // Q_CC_MSVC +#endif // Q_COMPILER_INITALIZER_LISTS template <typename T> void QVector<T>::freeData(Data *x) @@ -530,6 +530,11 @@ void QVector<T>::freeData(Data *x) Data::deallocate(x); } +#if defined(Q_CC_MSVC) +QT_WARNING_PUSH +QT_WARNING_DISABLE_MSVC(4127) // conditional expression is constant +#endif + template <typename T> void QVector<T>::reallocData(const int asize, const int aalloc, QArrayData::AllocationOptions options) { @@ -621,6 +626,10 @@ void QVector<T>::reallocData(const int asize, const int aalloc, QArrayData::Allo Q_ASSERT(d->size == asize); } +#if defined(Q_CC_MSVC) +QT_WARNING_POP +#endif + template<typename T> Q_OUTOFLINE_TEMPLATE T QVector<T>::value(int i) const { |