summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rwxr-xr-xutils/hash.h1
-rw-r--r--utils/small_vector.h9
2 files changed, 6 insertions, 4 deletions
diff --git a/utils/hash.h b/utils/hash.h
index 20764860..fbe10b4e 100755
--- a/utils/hash.h
+++ b/utils/hash.h
@@ -18,6 +18,7 @@
# define HASH_MAP_EMPTY(h,empty)
#endif
+#define BOOST_HASHED_MAP(k,v) HASH_MAP<k,v,boost::hash<k> >
// assumes C is POD
template <class C>
diff --git a/utils/small_vector.h b/utils/small_vector.h
index f1e53a51..89917d1c 100644
--- a/utils/small_vector.h
+++ b/utils/small_vector.h
@@ -253,11 +253,12 @@ public:
}
inline std::size_t hash_impl() const {
+ using namespace boost;
if (size_==0) return 0;
-// if (size_==1) return boost::hash_value(data_.vals[0]);
- if (size<= SV_MAX)
- return boost::hash_range(data_.vals,data_.vals+size_);
- return boost::hash_range(data_.ptr,data_.ptr+size_);
+ if (size_==1) return hash_value(data_.vals[0]);
+ if (size_ <= SV_MAX)
+ return hash_range(data_.vals,data_.vals+size_);
+ return hash_range(data_.ptr,data_.ptr+size_);
}
private: