mirror of
https://github.com/isar/libmdbx.git
synced 2024-12-30 02:04:12 +08:00
mdbx++: добавление типа mdbx::comparator
и функций mdbx::default_comparator()
(backport).
This commit is contained in:
parent
4bed5d1779
commit
0fd0d527d9
8
mdbx.h++
8
mdbx.h++
@ -3079,6 +3079,14 @@ struct LIBMDBX_API_TYPE map_handle {
|
||||
};
|
||||
};
|
||||
|
||||
using comparator = ::MDBX_cmp_func *;
|
||||
inline comparator default_comparator(key_mode mode) noexcept {
|
||||
return ::mdbx_get_keycmp(static_cast<MDBX_db_flags_t>(mode));
|
||||
}
|
||||
inline comparator default_comparator(value_mode mode) noexcept {
|
||||
return ::mdbx_get_keycmp(static_cast<MDBX_db_flags_t>(mode));
|
||||
}
|
||||
|
||||
/// \brief Key-value pairs put mode.
|
||||
enum put_mode {
|
||||
insert_unique = MDBX_NOOVERWRITE, ///< Insert only unique keys.
|
||||
|
Loading…
x
Reference in New Issue
Block a user