QHash: clean up class definition
...by removing redundant '<Key, T>' and 'inline'. Change-Id: I9d81950c6384927633de07de511712f7274a1283 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
390b16aea8
commit
6c8c72a9ef
|
|
@ -1146,7 +1146,7 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn QHash::QHash(QHash<Key, T> &&other)
|
||||
\fn QHash::QHash(QHash &&other)
|
||||
|
||||
Move-constructs a QHash instance, making it point at the same
|
||||
object that \a other was pointing to.
|
||||
|
|
@ -1164,7 +1164,7 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW
|
|||
compiled in C++11 mode.
|
||||
*/
|
||||
|
||||
/*! \fn QHash::QHash(const QHash<Key, T> &other)
|
||||
/*! \fn QHash::QHash(const QHash &other)
|
||||
|
||||
Constructs a copy of \a other.
|
||||
|
||||
|
|
@ -1182,34 +1182,34 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW
|
|||
iterators of this hash become invalid.
|
||||
*/
|
||||
|
||||
/*! \fn QHash<Key, T> &QHash::operator=(const QHash<Key, T> &other)
|
||||
/*! \fn QHash &QHash::operator=(const QHash &other)
|
||||
|
||||
Assigns \a other to this hash and returns a reference to this hash.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QHash<Key, T> &QHash::operator=(QHash<Key, T> &&other)
|
||||
\fn QHash &QHash::operator=(QHash &&other)
|
||||
|
||||
Move-assigns \a other to this QHash instance.
|
||||
|
||||
\since 5.2
|
||||
*/
|
||||
|
||||
/*! \fn void QHash::swap(QHash<Key, T> &other)
|
||||
/*! \fn void QHash::swap(QHash &other)
|
||||
\since 4.8
|
||||
|
||||
Swaps hash \a other with this hash. This operation is very
|
||||
fast and never fails.
|
||||
*/
|
||||
|
||||
/*! \fn void QMultiHash::swap(QMultiHash<Key, T> &other)
|
||||
/*! \fn void QMultiHash::swap(QMultiHash &other)
|
||||
\since 4.8
|
||||
|
||||
Swaps hash \a other with this hash. This operation is very
|
||||
fast and never fails.
|
||||
*/
|
||||
|
||||
/*! \fn bool QHash::operator==(const QHash<Key, T> &other) const
|
||||
/*! \fn bool QHash::operator==(const QHash &other) const
|
||||
|
||||
Returns \c true if \a other is equal to this hash; otherwise returns
|
||||
false.
|
||||
|
|
@ -1222,7 +1222,7 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW
|
|||
\sa operator!=()
|
||||
*/
|
||||
|
||||
/*! \fn bool QHash::operator!=(const QHash<Key, T> &other) const
|
||||
/*! \fn bool QHash::operator!=(const QHash &other) const
|
||||
|
||||
Returns \c true if \a other is not equal to this hash; otherwise
|
||||
returns \c false.
|
||||
|
|
@ -1322,7 +1322,7 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW
|
|||
\internal
|
||||
*/
|
||||
|
||||
/*! \fn bool QHash::isSharedWith(const QHash<Key, T> &other) const
|
||||
/*! \fn bool QHash::isSharedWith(const QHash &other) const
|
||||
|
||||
\internal
|
||||
*/
|
||||
|
|
@ -1644,7 +1644,7 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW
|
|||
\sa insert(), values()
|
||||
*/
|
||||
|
||||
/*! \fn QHash<Key, T> &QHash::unite(const QHash<Key, T> &other)
|
||||
/*! \fn QHash &QHash::unite(const QHash &other)
|
||||
|
||||
Inserts all the items in the \a other hash into this hash. If a
|
||||
key is common to both hashes, the resulting hash will contain the
|
||||
|
|
|
|||
|
|
@ -338,19 +338,19 @@ public:
|
|||
insert(it->first, it->second);
|
||||
}
|
||||
#endif
|
||||
inline QHash(const QHash<Key, T> &other) : d(other.d) { d->ref.ref(); if (!d->sharable) detach(); }
|
||||
inline ~QHash() { if (!d->ref.deref()) freeData(d); }
|
||||
QHash(const QHash &other) : d(other.d) { d->ref.ref(); if (!d->sharable) detach(); }
|
||||
~QHash() { if (!d->ref.deref()) freeData(d); }
|
||||
|
||||
QHash<Key, T> &operator=(const QHash<Key, T> &other);
|
||||
QHash &operator=(const QHash &other);
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
inline QHash(QHash<Key, T> &&other) Q_DECL_NOTHROW : d(other.d) { other.d = const_cast<QHashData *>(&QHashData::shared_null); }
|
||||
inline QHash<Key, T> &operator=(QHash<Key, T> &&other) Q_DECL_NOTHROW
|
||||
QHash(QHash &&other) Q_DECL_NOTHROW : d(other.d) { other.d = const_cast<QHashData *>(&QHashData::shared_null); }
|
||||
QHash &operator=(QHash &&other) Q_DECL_NOTHROW
|
||||
{ qSwap(d, other.d); return *this; }
|
||||
#endif
|
||||
inline void swap(QHash<Key, T> &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
|
||||
void swap(QHash &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
|
||||
|
||||
bool operator==(const QHash<Key, T> &other) const;
|
||||
inline bool operator!=(const QHash<Key, T> &other) const { return !(*this == other); }
|
||||
bool operator==(const QHash &other) const;
|
||||
bool operator!=(const QHash &other) const { return !(*this == other); }
|
||||
|
||||
inline int size() const { return d->size; }
|
||||
|
||||
|
|
@ -365,7 +365,7 @@ public:
|
|||
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
|
||||
inline void setSharable(bool sharable) { if (!sharable) detach(); if (d != &QHashData::shared_null) d->sharable = sharable; }
|
||||
#endif
|
||||
inline bool isSharedWith(const QHash<Key, T> &other) const { return d == other.d; }
|
||||
bool isSharedWith(const QHash &other) const { return d == other.d; }
|
||||
|
||||
void clear();
|
||||
|
||||
|
|
@ -528,7 +528,7 @@ public:
|
|||
const_iterator constFind(const Key &key) const;
|
||||
iterator insert(const Key &key, const T &value);
|
||||
iterator insertMulti(const Key &key, const T &value);
|
||||
QHash<Key, T> &unite(const QHash<Key, T> &other);
|
||||
QHash &unite(const QHash &other);
|
||||
|
||||
// STL compatibility
|
||||
typedef T mapped_type;
|
||||
|
|
@ -604,9 +604,9 @@ QHash<Key, T>::createNode(uint ah, const Key &akey, const T &avalue, Node **anex
|
|||
}
|
||||
|
||||
template <class Key, class T>
|
||||
Q_INLINE_TEMPLATE QHash<Key, T> &QHash<Key, T>::unite(const QHash<Key, T> &other)
|
||||
Q_INLINE_TEMPLATE QHash<Key, T> &QHash<Key, T>::unite(const QHash &other)
|
||||
{
|
||||
QHash<Key, T> copy(other);
|
||||
QHash copy(other);
|
||||
const_iterator it = copy.constEnd();
|
||||
while (it != copy.constBegin()) {
|
||||
--it;
|
||||
|
|
@ -624,7 +624,7 @@ Q_OUTOFLINE_TEMPLATE void QHash<Key, T>::freeData(QHashData *x)
|
|||
template <class Key, class T>
|
||||
Q_INLINE_TEMPLATE void QHash<Key, T>::clear()
|
||||
{
|
||||
*this = QHash<Key,T>();
|
||||
*this = QHash();
|
||||
}
|
||||
|
||||
template <class Key, class T>
|
||||
|
|
@ -637,7 +637,7 @@ Q_OUTOFLINE_TEMPLATE void QHash<Key, T>::detach_helper()
|
|||
}
|
||||
|
||||
template <class Key, class T>
|
||||
Q_INLINE_TEMPLATE QHash<Key, T> &QHash<Key, T>::operator=(const QHash<Key, T> &other)
|
||||
Q_INLINE_TEMPLATE QHash<Key, T> &QHash<Key, T>::operator=(const QHash &other)
|
||||
{
|
||||
if (d != other.d) {
|
||||
QHashData *o = other.d;
|
||||
|
|
@ -965,7 +965,7 @@ Q_OUTOFLINE_TEMPLATE typename QHash<Key, T>::Node **QHash<Key, T>::findNode(cons
|
|||
}
|
||||
|
||||
template <class Key, class T>
|
||||
Q_OUTOFLINE_TEMPLATE bool QHash<Key, T>::operator==(const QHash<Key, T> &other) const
|
||||
Q_OUTOFLINE_TEMPLATE bool QHash<Key, T>::operator==(const QHash &other) const
|
||||
{
|
||||
if (size() != other.size())
|
||||
return false;
|
||||
|
|
@ -1004,7 +1004,7 @@ public:
|
|||
}
|
||||
#endif
|
||||
QMultiHash(const QHash<Key, T> &other) : QHash<Key, T>(other) {}
|
||||
inline void swap(QMultiHash<Key, T> &other) { QHash<Key, T>::swap(other); } // prevent QMultiHash<->QHash swaps
|
||||
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)
|
||||
{ return QHash<Key, T>::insert(key, value); }
|
||||
|
|
|
|||
Loading…
Reference in New Issue