mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:34:13 +08:00
mdbx++: add std::hash<>
specialization for mdbx::slice
.
Change-Id: I4402122f0f088bfa8eea753df931537cfe935086
This commit is contained in:
parent
fde4186883
commit
75e360b8b3
9
mdbx.h++
9
mdbx.h++
@ -4624,6 +4624,15 @@ inline std::string to_string(const ::MDBX_error_t &errcode) {
|
|||||||
|
|
||||||
} // namespace mdbx
|
} // 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
|
#ifdef _MSC_VER
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user