cvc4-1.4
hash.h
Go to the documentation of this file.
1
/********************* */
18
#include "
cvc4_public.h
"
19
20
#ifndef __CVC4__HASH_H
21
#define __CVC4__HASH_H
22
23
// in case it's not been declared as a namespace yet
24
namespace
__gnu_cxx
{}
25
26
#include <ext/hash_map>
27
#include <ext/hash_set>
28
29
namespace
__gnu_cxx
{
30
31
#ifdef CVC4_NEED_HASH_UINT64_T
32
// on some versions and architectures of GNU C++, we need a
33
// specialization of hash for 64-bit values
34
template
<>
35
struct
hash<uint64_t> {
36
size_t
operator()(uint64_t v)
const
{
37
return
v;
38
}
39
};
/* struct hash<uint64_t> */
40
#endif
/* CVC4_NEED_HASH_UINT64_T */
41
42
}
/* __gnu_cxx namespace */
43
44
// hackish: treat hash stuff as if it were in std namespace
45
namespace
std
{
using namespace
__gnu_cxx
; }
46
47
namespace
CVC4
{
48
49
struct
StringHashFunction
{
50
size_t
operator()
(
const
std::string& str)
const
{
51
return
__gnu_cxx::hash<const char*>
()(str.c_str());
52
}
53
};
/* struct StringHashFunction */
54
55
template
<
class
T,
class
U,
class
HashT = std::hash<T>,
class
HashU = std::hash<U> >
56
struct
PairHashFunction
{
57
size_t
operator()
(
const
std::pair<T, U>& pr)
const
{
58
return
HashT()(pr.first) ^ HashU()(pr.second);
59
}
60
};
/* struct PairHashFunction */
61
62
}
/* CVC4 namespace */
63
64
#endif
/* __CVC4__HASH_H */
cvc4_public.h
Macros that should be defined everywhere during the building of the libraries and driver binary,...
CVC4
Definition
expr.h:106
__gnu_cxx
Definition
cdinsert_hashmap_forward.h:28
std
STL namespace.
CVC4::PairHashFunction
Definition
hash.h:56
CVC4::PairHashFunction::operator()
size_t operator()(const std::pair< T, U > &pr) const
Definition
hash.h:57
CVC4::StringHashFunction
Definition
hash.h:49
CVC4::StringHashFunction::operator()
size_t operator()(const std::string &str) const
Definition
hash.h:50
__gnu_cxx::hash
Definition
cdtrail_hashmap_forward.h:29
src
util
hash.h
Generated by
1.11.0