QNativeIpcKey: normalize docs for qHash()
The C++ standard forces¹ us to overload the hidden friend qHash() implementation instead of defaulting `seed` to zero. That doesn't mean we need to reflect that technicality in the docs, esp. if it forces us to deviate from the standard phrasing of qHash() functions to say something about the default value of `seed` (which would, for a defaulted argument, be shown in the docs). Present the qHash() function in the canonical form to QDoc. This is a (forwards and backwards) BC way to solve the issue. Going forward, the correct fix should be to have qHash() functions call a private hash(seed) member function instead, to fulfill the pointless requirement of [1]. ¹ [dcl.fct.default]/4, last sentence Amends c2310f8e03cf30222cea59b3c556d060e1710015. Task-number: QTBUG-129574 Change-Id: I7890a0df092c9780601fc4c25e23d70d92db47e1 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> (cherry picked from commit 27d792869b30721cecf493a54d89e9df6e75a6fa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
296bae3f10
commit
ca1b4baf09
@ -496,12 +496,6 @@ void QNativeIpcKey::setNativeKey_internal(const QString &)
|
|||||||
d->legacyKey_.clear();
|
d->legacyKey_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn size_t QNativeIpcKey::qHash(const QNativeIpcKey &ipcKey) noexcept
|
|
||||||
|
|
||||||
Returns the hash value for \a ipcKey, using a default seed of \c 0.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn size_t QNativeIpcKey::qHash(const QNativeIpcKey &ipcKey, size_t seed) noexcept
|
\fn size_t QNativeIpcKey::qHash(const QNativeIpcKey &ipcKey, size_t seed) noexcept
|
||||||
|
|
||||||
|
@ -153,9 +153,13 @@ private:
|
|||||||
constexpr bool isSlowPath() const noexcept
|
constexpr bool isSlowPath() const noexcept
|
||||||
{ return Q_UNLIKELY(d); }
|
{ return Q_UNLIKELY(d); }
|
||||||
|
|
||||||
|
#ifdef Q_QDOC
|
||||||
|
friend size_t qHash(const QNativeIpcKey &ipcKey, size_t seed = 0) noexcept { return 0; }
|
||||||
|
#else
|
||||||
friend Q_CORE_EXPORT size_t qHash(const QNativeIpcKey &ipcKey, size_t seed) noexcept;
|
friend Q_CORE_EXPORT size_t qHash(const QNativeIpcKey &ipcKey, size_t seed) noexcept;
|
||||||
friend size_t qHash(const QNativeIpcKey &ipcKey) noexcept
|
friend size_t qHash(const QNativeIpcKey &ipcKey) noexcept
|
||||||
{ return qHash(ipcKey, 0); }
|
{ return qHash(ipcKey, 0); }
|
||||||
|
#endif
|
||||||
|
|
||||||
Q_CORE_EXPORT void copy_internal(const QNativeIpcKey &other);
|
Q_CORE_EXPORT void copy_internal(const QNativeIpcKey &other);
|
||||||
Q_CORE_EXPORT void move_internal(QNativeIpcKey &&other) noexcept;
|
Q_CORE_EXPORT void move_internal(QNativeIpcKey &&other) noexcept;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user