From 99cabee246338da7b2d6fc959cce16943d4149e9 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 6 Sep 2023 12:24:20 +0200 Subject: [PATCH] Sqlite: Add hash operator to BasicId Because QHash is supporting std::hash we don't need to add a qHash function. That is saving us an include to qhashfunction.h too. Change-Id: I457051c828d25771028f3f28bf19ecb65c51edd1 Reviewed-by: Thomas Hartmann Reviewed-by: Qt CI Patch Build Bot --- src/libs/sqlite/sqliteids.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/libs/sqlite/sqliteids.h b/src/libs/sqlite/sqliteids.h index 6296f84718a..2309bd58e5a 100644 --- a/src/libs/sqlite/sqliteids.h +++ b/src/libs/sqlite/sqliteids.h @@ -78,3 +78,14 @@ auto toIntegers(const Container &container) } } // namespace Sqlite + +namespace std { +template +struct hash> +{ + auto operator()(const Sqlite::BasicId &id) const + { + return std::hash(id.internalId()); + } +}; +} // namespace std