diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-10-14 15:45:35 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-10-14 15:45:35 +0200 |
commit | 4456984da780b14572e1ec0f079a4d349ab299bd (patch) | |
tree | f586a281a81c57c91c49e83a5d3ec6c7eece0578 /src/corelib/tools/qmap.h | |
parent | e824abd987d77efaa085fe1f9fb514d270798d55 (diff) | |
parent | 281121697340084f7d385eab530f41916789b94d (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
tests/auto/corelib/io/qfile/tst_qfile.cpp
tests/auto/corelib/io/qprocess/tst_qprocess.cpp
tests/auto/corelib/tools/qversionnumber/qversionnumber.pro
Change-Id: Ia93ce500349d96a2fbf0b4a37b73f088cc505c6e
Diffstat (limited to 'src/corelib/tools/qmap.h')
-rw-r--r-- | src/corelib/tools/qmap.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index b7bd268bda..fe9ddaaa32 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -321,7 +321,7 @@ class QMap QMapData<Key, T> *d; public: - inline QMap() : d(static_cast<QMapData<Key, T> *>(const_cast<QMapDataBase *>(&QMapDataBase::shared_null))) { } + inline QMap() Q_DECL_NOTHROW : d(static_cast<QMapData<Key, T> *>(const_cast<QMapDataBase *>(&QMapDataBase::shared_null))) { } #ifdef Q_COMPILER_INITIALIZER_LISTS inline QMap(std::initializer_list<std::pair<Key,T> > list) : d(static_cast<QMapData<Key, T> *>(const_cast<QMapDataBase *>(&QMapDataBase::shared_null))) @@ -336,17 +336,17 @@ public: QMap<Key, T> &operator=(const QMap<Key, T> &other); #ifdef Q_COMPILER_RVALUE_REFS - inline QMap(QMap<Key, T> &&other) + inline QMap(QMap<Key, T> &&other) Q_DECL_NOTHROW : d(other.d) { other.d = static_cast<QMapData<Key, T> *>( const_cast<QMapDataBase *>(&QMapDataBase::shared_null)); } - inline QMap<Key, T> &operator=(QMap<Key, T> &&other) + inline QMap<Key, T> &operator=(QMap<Key, T> &&other) Q_DECL_NOTHROW { QMap moved(std::move(other)); swap(moved); return *this; } #endif - inline void swap(QMap<Key, T> &other) { qSwap(d, other.d); } + inline void swap(QMap<Key, T> &other) Q_DECL_NOTHROW { qSwap(d, other.d); } explicit QMap(const typename std::map<Key, T> &other); std::map<Key, T> toStdMap() const; @@ -1168,7 +1168,7 @@ template <class Key, class T> class QMultiMap : public QMap<Key, T> { public: - QMultiMap() {} + QMultiMap() Q_DECL_NOTHROW {} #ifdef Q_COMPILER_INITIALIZER_LISTS inline QMultiMap(std::initializer_list<std::pair<Key,T> > list) { @@ -1177,7 +1177,10 @@ public: } #endif QMultiMap(const QMap<Key, T> &other) : QMap<Key, T>(other) {} - inline void swap(QMultiMap<Key, T> &other) { QMap<Key, T>::swap(other); } +#ifdef Q_COMPILER_RVALUE_REFS + QMultiMap(QMap<Key, T> &&other) Q_DECL_NOTHROW : QMap<Key, T>(std::move(other)) {} +#endif + void swap(QMultiMap<Key, T> &other) Q_DECL_NOTHROW { QMap<Key, T>::swap(other); } inline typename QMap<Key, T>::iterator replace(const Key &key, const T &value) { return QMap<Key, T>::insert(key, value); } |