mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
GModelIndex: Add hash traits so we can make a HashTable<GModelIndex>
This commit is contained in:
parent
60cd3c093a
commit
19b69741ed
1 changed files with 8 additions and 1 deletions
|
@ -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()); }
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue