Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
HashNamespace.h
Go to the documentation of this file.
1
/*
2
* This file is part of Project SkyFire https://www.projectskyfire.org.
3
* See LICENSE.md file for Copyright information
4
*/
5
6
#ifndef SKYFIRE_HASH_NAMESPACE_H
7
#define SKYFIRE_HASH_NAMESPACE_H
8
9
#include "
Define.h
"
10
11
#if COMPILER_HAS_CPP11_SUPPORT
12
# define HASH_NAMESPACE_START namespace std {
13
# define HASH_NAMESPACE_END }
14
#elif defined(_STLPORT_VERSION)
15
# define HASH_NAMESPACE_START namespace std {
16
# define HASH_NAMESPACE_END }
17
#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1600
// VS100
18
# define HASH_NAMESPACE_START namespace std {
19
# define HASH_NAMESPACE_END }
20
#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1500 && _HAS_TR1
21
# define HASH_NAMESPACE_START namespace std { namespace tr1 {
22
# define HASH_NAMESPACE_END } }
23
#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1300
24
# define HASH_NAMESPACE_START namespace stdext {
25
# define HASH_NAMESPACE_END }
26
27
#if !_HAS_TRADITIONAL_STL
28
#ifndef HASH_NAMESPACE
29
#define HASH_NAMESPACE
30
#else
31
32
// can be not used by some platforms, so provide fake forward
33
HASH_NAMESPACE_START
34
35
template
<
class
K>
36
class
hash
37
{
38
public
:
39
size_t
operator() (K
const
&);
40
};
41
42
HASH_NAMESPACE_END
43
44
#endif
45
#endif
46
47
#elif COMPILER == COMPILER_INTEL
48
# define HASH_NAMESPACE_START namespace std {
49
# define HASH_NAMESPACE_END }
50
#elif COMPILER == COMPILER_GNU && defined(__clang__) && defined(_LIBCPP_VERSION)
51
# define HASH_NAMESPACE_START namespace std {
52
# define HASH_NAMESPACE_END }
53
#elif COMPILER == COMPILER_GNU && GCC_VERSION > 40200
54
# define HASH_NAMESPACE_START namespace std { namespace tr1 {
55
# define HASH_NAMESPACE_END } }
56
#elif COMPILER == COMPILER_GNU && GCC_VERSION >= 30000
57
# define HASH_NAMESPACE_START namespace __gnu_cxx {
58
# define HASH_NAMESPACE_END }
59
60
#include <ext/hash_fun.h>
61
#include <string>
62
63
HASH_NAMESPACE_START
64
65
template
<>
66
class
hash<unsigned long long>
67
{
68
public
:
69
size_t
operator()(
const
unsigned
long
long
& __x)
const
{
return
(
size_t
)__x; }
70
};
71
72
template
<
typename
T>
73
class
hash<T*>
74
{
75
public
:
76
size_t
operator()(T*
const
& __x)
const
{
return
(
size_t
)__x; }
77
};
78
79
template
<>
struct
hash<std::string>
80
{
81
size_t
operator()(
const
std::string& __x)
const
82
{
83
return
hash<char const*>()(__x.c_str());
84
}
85
};
86
87
HASH_NAMESPACE_END
88
89
#else
90
# define HASH_NAMESPACE_START namespace std {
91
# define HASH_NAMESPACE_END }
92
#endif
93
94
#if COMPILER != COMPILER_MICROSOFT
95
96
// Visual Studio use non standard hash calculation function, so provide fake forward for other
97
HASH_NAMESPACE_START
98
99
template
<
class
K>
100
size_t
hash_value(K
const
&);
101
102
HASH_NAMESPACE_END
103
104
#endif
105
106
#endif
Define.h
HASH_NAMESPACE_START
#define HASH_NAMESPACE_START
Definition
HashNamespace.h:90
HASH_NAMESPACE_END
#define HASH_NAMESPACE_END
Definition
HashNamespace.h:91
src
server
shared
Dynamic
HashNamespace.h
Generated on
for Project SkyFire Core by
1.17.0