]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/hashcomp.h
e75e84ef4f9d88695e60b8eb0fd75a1f4ebe2e3c
[user/henk/code/inspircd.git] / include / hashcomp.h
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  Inspire is copyright (C) 2002-2005 ChatSpike-Dev.
6  *                       E-mail:
7  *                <brain@chatspike.net>
8  *                <Craig@chatspike.net>
9  *
10  * Written by Craig Edwards, Craig McLure, and others.
11  * This program is free but copyrighted software; see
12  *            the file COPYING for details.
13  *
14  * ---------------------------------------------------
15  */
16
17 #ifndef _HASHCOMP_H_
18 #define _HASHCOMP_H_
19
20 #include "inspircd_config.h"
21
22 #ifdef GCC3
23 #include <ext/hash_map>
24 #else
25 #include <hash_map>
26 #endif
27
28 #ifdef GCC3
29 #define nspace __gnu_cxx
30 #else
31 #define nspace std
32 #endif
33
34 using namespace std;
35
36 namespace nspace
37 {
38 #ifdef GCC34
39         template<> struct hash<in_addr>
40 #else
41         template<> struct nspace::hash<in_addr>
42 #endif
43         {
44                 size_t operator()(const struct in_addr &a) const;
45         };
46 #ifdef GCC34
47         template<> struct hash<string>
48 #else
49         template<> struct nspace::hash<string>
50 #endif
51         {
52                 size_t operator()(const string &s) const;
53         };
54 }
55
56
57 struct StrHashComp
58 {
59
60         bool operator()(const string& s1, const string& s2) const;
61 };
62
63 struct InAddr_HashComp
64 {
65         bool operator()(const in_addr &s1, const in_addr &s2) const;
66 };
67
68
69
70 #endif