1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +00:00

GModelIndex: Add hash traits so we can make a HashTable<GModelIndex>

This commit is contained in:
Andreas Kling 2019-09-07 19:17:03 +02:00
parent 60cd3c093a
commit 19b69741ed

View file

@ -1,7 +1,7 @@
#pragma once
#include <AK/String.h>
#include <AK/LogStream.h>
#include <AK/String.h>
class GModel;
@ -48,3 +48,10 @@ inline const LogStream& operator<<(const LogStream& stream, const GModelIndex& v
{
return stream << String::format("GModelIndex(%d,%d)", value.row(), value.column());
}
namespace AK {
template<>
struct Traits<GModelIndex> : public GenericTraits<GModelIndex> {
static unsigned hash(const GModelIndex& index) { return pair_int_hash(index.row(), index.column()); }
};
}