diff options
author | Tim King <taking@cs.nyu.edu> | 2017-07-20 17:04:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-20 17:04:30 -0700 |
commit | 8b0659e6cd342ae40b676781b5e819d5fd2b3af7 (patch) | |
tree | 5ac55f64d115b3e8865ce8f691f38da65fc82a94 /src/util/hash.h | |
parent | 6d82ee2d1f84065ff4a86f688a3b671b85728f80 (diff) |
Moving from the gnu extensions for hash maps to the c++11 hash maps
* Replacing __gnu_cxx::hash_map with std::unordered_map.
* Replacing __gnu_cxx::hash_set with std::unordered_set.
* Replacing __gnu_cxx::hash with std::hash.
* Adding missing includes.
Diffstat (limited to 'src/util/hash.h')
-rw-r--r-- | src/util/hash.h | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/util/hash.h b/src/util/hash.h index af468e25b..b04fb8bb5 100644 --- a/src/util/hash.h +++ b/src/util/hash.h @@ -20,13 +20,10 @@ #ifndef __CVC4__HASH_H #define __CVC4__HASH_H -// in case it's not been declared as a namespace yet -namespace __gnu_cxx {} +#include <functional> +#include <string> -#include <ext/hash_map> -#include <ext/hash_set> - -namespace __gnu_cxx { +namespace std { #ifdef CVC4_NEED_HASH_UINT64_T // on some versions and architectures of GNU C++, we need a @@ -39,18 +36,10 @@ struct hash<uint64_t> { };/* struct hash<uint64_t> */ #endif /* CVC4_NEED_HASH_UINT64_T */ -}/* __gnu_cxx namespace */ - -// hackish: treat hash stuff as if it were in std namespace -namespace std { using namespace __gnu_cxx; } +}/* std namespace */ namespace CVC4 { -struct StringHashFunction { - size_t operator()(const std::string& str) const { - return __gnu_cxx::hash<const char*>()(str.c_str()); - } -};/* struct StringHashFunction */ template <class T, class U, class HashT = std::hash<T>, class HashU = std::hash<U> > struct PairHashFunction { |