mdbx++: add std::hash<> specialization for mdbx::slice.

Change-Id: I4402122f0f088bfa8eea753df931537cfe935086
This commit is contained in:
Leonid Yuriev 2020-09-28 17:21:12 +03:00
parent fde4186883
commit 75e360b8b3

View File

@ -4624,6 +4624,15 @@ inline std::string to_string(const ::MDBX_error_t &errcode) {
} // namespace mdbx
namespace std {
template <> struct hash<mdbx::slice> {
MDBX_CXX14_CONSTEXPR size_t
operator()(mdbx::slice const &slice) const noexcept {
return slice.hash_value();
}
};
} // namespace std
#ifdef _MSC_VER
#pragma warning(pop)
#endif