mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-14 02:10:36 +00:00
0dc9af5f7e
Also run it across the whole tree to get everything using the One True Style. We don't yet run this in an automated fashion as it's a little slow, but there is a snippet to do so in makeall.sh.
39 lines
757 B
C++
39 lines
757 B
C++
#pragma once
|
|
|
|
#include "HashFunctions.h"
|
|
#include "kstdio.h"
|
|
|
|
namespace AK {
|
|
|
|
template<typename T>
|
|
struct Traits {
|
|
};
|
|
|
|
template<>
|
|
struct Traits<int> {
|
|
static unsigned hash(int i) { return int_hash(i); }
|
|
static void dump(int i) { kprintf("%d", i); }
|
|
};
|
|
|
|
template<>
|
|
struct Traits<unsigned> {
|
|
static unsigned hash(unsigned u) { return int_hash(u); }
|
|
static void dump(unsigned u) { kprintf("%u", u); }
|
|
};
|
|
|
|
template<>
|
|
struct Traits<word> {
|
|
static unsigned hash(unsigned u) { return int_hash(u); }
|
|
static void dump(unsigned u) { kprintf("%u", u); }
|
|
};
|
|
|
|
template<typename T>
|
|
struct Traits<T*> {
|
|
static unsigned hash(const T* p)
|
|
{
|
|
return int_hash((dword)p);
|
|
}
|
|
static void dump(const T* p) { kprintf("%p", p); }
|
|
};
|
|
|
|
}
|