From 0e5d632e5b43fbf218b82d9bf6d694d1fbb82361 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 19 Oct 2021 10:56:15 +0200 Subject: [PATCH] Move FilePath's hash methods to the right header Change-Id: Ie3932daf381bc03f37ae67722dcddc5b2e4823e5 Reviewed-by: Qt CI Bot Reviewed-by: David Schulz --- src/libs/utils/filepath.h | 15 +++++++++++++++ src/libs/utils/fileutils.h | 11 ----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/libs/utils/filepath.h b/src/libs/utils/filepath.h index 21ef3e12438..474f2c1416c 100644 --- a/src/libs/utils/filepath.h +++ b/src/libs/utils/filepath.h @@ -201,6 +201,11 @@ private: using FilePaths = QList; +inline uint qHash(const Utils::FilePath &a, uint seed = 0) +{ + return a.hash(seed); +} + } // namespace Utils QT_BEGIN_NAMESPACE @@ -208,3 +213,13 @@ QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug dbg, const Utils::FilePath &c); QT_END_NAMESPACE Q_DECLARE_METATYPE(Utils::FilePath) + +namespace std { +template<> +struct QTCREATOR_UTILS_EXPORT hash +{ + using argument_type = Utils::FilePath; + using result_type = size_t; + result_type operator()(const argument_type &fn) const; +}; +} // namespace std diff --git a/src/libs/utils/fileutils.h b/src/libs/utils/fileutils.h index 9fd0b6c2a03..c87ca5d5dd0 100644 --- a/src/libs/utils/fileutils.h +++ b/src/libs/utils/fileutils.h @@ -316,16 +316,5 @@ private: QTCREATOR_UTILS_EXPORT QTextStream &operator<<(QTextStream &s, const FilePath &fn); -inline uint qHash(const Utils::FilePath &a, uint seed = 0) { return a.hash(seed); } - } // namespace Utils -namespace std { -template<> struct QTCREATOR_UTILS_EXPORT hash -{ - using argument_type = Utils::FilePath; - using result_type = size_t; - result_type operator()(const argument_type &fn) const; -}; -} // namespace std -