forked from qt-creator/qt-creator
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 <thomas.hartmann@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
@@ -78,3 +78,14 @@ auto toIntegers(const Container &container)
|
||||
}
|
||||
|
||||
} // namespace Sqlite
|
||||
|
||||
namespace std {
|
||||
template<auto Type, typename InternalIntegerType>
|
||||
struct hash<Sqlite::BasicId<Type, InternalIntegerType>>
|
||||
{
|
||||
auto operator()(const Sqlite::BasicId<Type, InternalIntegerType> &id) const
|
||||
{
|
||||
return std::hash<InternalIntegerType>(id.internalId());
|
||||
}
|
||||
};
|
||||
} // namespace std
|
||||
|
Reference in New Issue
Block a user