23 #ifndef SPOT_MISC_HASH_HH
24 # define SPOT_MISC_HASH_HH
27 # include <functional>
28 # include "misc/hashfunc.hh"
29 # include "misc/_config.h"
31 #ifdef SPOT_HAVE_UNORDERED_MAP
32 # include <unordered_map>
33 # include <unordered_set>
35 # define hash_map unordered_map
36 # define hash_multimap unordered_multimap
37 # define hash_set unordered_set
39 #ifdef SPOT_HAVE_TR1_UNORDERED_MAP
40 # include <tr1/unordered_map>
41 # include <tr1/unordered_set>
42 namespace Sgi = std::tr1;
43 # define hash_map unordered_map
44 # define hash_multimap unordered_multimap
45 # define hash_set unordered_set
47 #ifdef SPOT_HAVE_EXT_HASH_MAP
48 # include <ext/hash_map>
49 # include <ext/hash_set>
50 # if __GNUC__ == 3 && __GNUC_MINOR__ == 0
53 namespace Sgi = ::__gnu_cxx;
56 # if defined(__GNUC__) && (__GNUC__ < 3)
57 # include <hash_map.h>
58 # include <hash_set.h>
62 using ::hash_multimap;
82 public std::unary_function<const T*, size_t>
91 size_t operator()(
const T* p)
const
94 - static_cast<const char*>(0));
101 #if defined(SPOT_HAVE_UNORDERED_MAP) || defined(SPOT_HAVE_TR1_UNORDERED_MAP)
103 #else // e.g. GCC < 4.3
105 public Sgi::hash<const char*>,
106 public std::unary_function<const std::string&, size_t>
114 size_t operator()(
const std::string& s)
const
118 return Sgi::hash<const char*>::operator()(s.c_str());
128 public std::unary_function<const T&, size_t>
136 size_t operator()(
const T& s)
const
143 #endif // SPOT_MISC_HASH_HH