diff --git a/mdbx.h++ b/mdbx.h++ index fb7fb166..eba58b50 100644 --- a/mdbx.h++ +++ b/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(mode)); +} +inline comparator default_comparator(value_mode mode) noexcept { + return ::mdbx_get_keycmp(static_cast(mode)); +} + /// \brief Key-value pairs put mode. enum put_mode { insert_unique = MDBX_NOOVERWRITE, ///< Insert only unique keys.