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