QMulti(Map|Hash): add move ctor from Q(Map|Hash)
There was a copy ctor, a move ctor was missing. Change-Id: If09a4d4c74682169759eff43b298f6c77702c169 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
parent
eb88d77a27
commit
52812e9a2b
@ -948,6 +948,9 @@ public:
|
||||
// compiler-generated destructor is fine!
|
||||
|
||||
QMultiHash(const QHash<Key, T> &other) : QHash<Key, T>(other) {}
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
QMultiHash(QHash<Key, T> &&other) Q_DECL_NOTHROW : QHash<Key, T>(std::move(other)) {}
|
||||
#endif
|
||||
void swap(QMultiHash &other) { QHash<Key, T>::swap(other); } // prevent QMultiHash<->QHash swaps
|
||||
|
||||
inline typename QHash<Key, T>::iterator replace(const Key &key, const T &value)
|
||||
|
@ -1177,6 +1177,9 @@ public:
|
||||
}
|
||||
#endif
|
||||
QMultiMap(const QMap<Key, T> &other) : QMap<Key, T>(other) {}
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
QMultiMap(QMap<Key, T> &&other) Q_DECL_NOTHROW : QMap<Key, T>(std::move(other)) {}
|
||||
#endif
|
||||
inline void swap(QMultiMap<Key, T> &other) { QMap<Key, T>::swap(other); }
|
||||
|
||||
inline typename QMap<Key, T>::iterator replace(const Key &key, const T &value)
|
||||
|
Loading…
Reference in New Issue
Block a user