]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/hashcomp.h
(Untested) added hashcomp.cpp, seperates out the stl hash_map stuff
[user/henk/code/inspircd.git] / include / hashcomp.h
1 #ifndef _HASHCOMP_H_
2 #define _HASHCOMP_H_
3
4 #include "inspircd_config.h"
5
6 #ifdef GCC3
7 #include <ext/hash_map>
8 #else
9 #include <hash_map>
10 #endif
11
12 #ifdef GCC3
13 #define nspace __gnu_cxx
14 #else
15 #define nspace std
16 #endif
17
18 using namespace std;
19
20 namespace nspace
21 {
22 #ifdef GCC34
23         template<> struct hash<in_addr>
24 #else
25         template<> struct nspace::hash<in_addr>
26 #endif
27         {
28                 size_t operator()(const struct in_addr &a) const;
29         };
30 #ifdef GCC34
31         template<> struct hash<string>
32 #else
33         template<> struct nspace::hash<string>
34 #endif
35         {
36                 size_t operator()(const string &s) const;
37         };
38 }
39
40
41 struct StrHashComp
42 {
43
44         bool operator()(const string& s1, const string& s2) const;
45 };
46
47 struct InAddr_HashComp
48 {
49         bool operator()(const in_addr &s1, const in_addr &s2) const;
50 };
51
52
53
54 #endif