2018-10-10 09:53:07 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-10-17 08:55:43 +00:00
|
|
|
#include "kstdio.h"
|
2018-10-10 09:53:07 +00:00
|
|
|
|
|
|
|
namespace AK {
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
struct Traits
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
template<>
|
|
|
|
struct Traits<int> {
|
|
|
|
static unsigned hash(int i) { return i; }
|
2018-10-17 08:55:43 +00:00
|
|
|
static void dump(int i) { kprintf("%d", i); }
|
2018-10-10 09:53:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
template<>
|
|
|
|
struct Traits<unsigned> {
|
|
|
|
static unsigned hash(unsigned u) { return u; }
|
2018-10-17 08:55:43 +00:00
|
|
|
static void dump(unsigned u) { kprintf("%u", u); }
|
2018-10-10 09:53:07 +00:00
|
|
|
};
|
|
|
|
|
2018-10-11 14:52:30 +00:00
|
|
|
template<typename T>
|
|
|
|
struct Traits<T*> {
|
|
|
|
static unsigned hash(const T* p) { return (unsigned)p; }
|
2018-10-17 08:55:43 +00:00
|
|
|
static void dump(const T* p) { kprintf("%p", p); }
|
2018-10-11 14:52:30 +00:00
|
|
|
};
|
|
|
|
|
2018-10-10 09:53:07 +00:00
|
|
|
}
|
|
|
|
|