mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-31 10:58:20 +08:00
mdbx++: добавление MDBX_CXXnn_CONSTEXPR_ENUM
.
This commit is contained in:
parent
bf21ee7bde
commit
b9e2f6dc09
40
mdbx.h++
40
mdbx.h++
@ -162,6 +162,20 @@
|
|||||||
#define MDBX_CXX20_CONSTEXPR inline
|
#define MDBX_CXX20_CONSTEXPR inline
|
||||||
#endif /* MDBX_CXX20_CONSTEXPR */
|
#endif /* MDBX_CXX20_CONSTEXPR */
|
||||||
|
|
||||||
|
#if CONSTEXPR_ENUM_FLAGS_OPERATIONS || defined(DOXYGEN)
|
||||||
|
#define MDBX_CXX01_CONSTEXPR_ENUM MDBX_CXX01_CONSTEXPR
|
||||||
|
#define MDBX_CXX11_CONSTEXPR_ENUM MDBX_CXX11_CONSTEXPR
|
||||||
|
#define MDBX_CXX14_CONSTEXPR_ENUM MDBX_CXX14_CONSTEXPR
|
||||||
|
#define MDBX_CXX17_CONSTEXPR_ENUM MDBX_CXX17_CONSTEXPR
|
||||||
|
#define MDBX_CXX20_CONSTEXPR_ENUM MDBX_CXX20_CONSTEXPR
|
||||||
|
#else
|
||||||
|
#define MDBX_CXX01_CONSTEXPR_ENUM inline
|
||||||
|
#define MDBX_CXX11_CONSTEXPR_ENUM inline
|
||||||
|
#define MDBX_CXX14_CONSTEXPR_ENUM inline
|
||||||
|
#define MDBX_CXX17_CONSTEXPR_ENUM inline
|
||||||
|
#define MDBX_CXX20_CONSTEXPR_ENUM inline
|
||||||
|
#endif /* CONSTEXPR_ENUM_FLAGS_OPERATIONS */
|
||||||
|
|
||||||
/** Workaround for old compilers without support assertion inside `constexpr`
|
/** Workaround for old compilers without support assertion inside `constexpr`
|
||||||
* functions. */
|
* functions. */
|
||||||
#if defined(CONSTEXPR_ASSERT)
|
#if defined(CONSTEXPR_ASSERT)
|
||||||
@ -3198,18 +3212,8 @@ struct LIBMDBX_API_TYPE map_handle {
|
|||||||
map_handle::state state) noexcept;
|
map_handle::state state) noexcept;
|
||||||
info(const info &) noexcept = default;
|
info(const info &) noexcept = default;
|
||||||
info &operator=(const info &) noexcept = default;
|
info &operator=(const info &) noexcept = default;
|
||||||
#if CONSTEXPR_ENUM_FLAGS_OPERATIONS
|
MDBX_CXX11_CONSTEXPR_ENUM mdbx::key_mode key_mode() const noexcept;
|
||||||
MDBX_CXX11_CONSTEXPR
|
MDBX_CXX11_CONSTEXPR_ENUM mdbx::value_mode value_mode() const noexcept;
|
||||||
#else
|
|
||||||
inline
|
|
||||||
#endif
|
|
||||||
::mdbx::key_mode key_mode() const noexcept;
|
|
||||||
#if CONSTEXPR_ENUM_FLAGS_OPERATIONS
|
|
||||||
MDBX_CXX11_CONSTEXPR
|
|
||||||
#else
|
|
||||||
inline
|
|
||||||
#endif
|
|
||||||
::mdbx::value_mode value_mode() const noexcept;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -5491,17 +5495,13 @@ MDBX_CXX11_CONSTEXPR map_handle::info::info(map_handle::flags flags,
|
|||||||
map_handle::state state) noexcept
|
map_handle::state state) noexcept
|
||||||
: flags(flags), state(state) {}
|
: flags(flags), state(state) {}
|
||||||
|
|
||||||
#if CONSTEXPR_ENUM_FLAGS_OPERATIONS
|
MDBX_CXX11_CONSTEXPR_ENUM mdbx::key_mode
|
||||||
MDBX_CXX11_CONSTEXPR
|
map_handle::info::key_mode() const noexcept {
|
||||||
#endif
|
|
||||||
::mdbx::key_mode map_handle::info::key_mode() const noexcept {
|
|
||||||
return ::mdbx::key_mode(flags & (MDBX_REVERSEKEY | MDBX_INTEGERKEY));
|
return ::mdbx::key_mode(flags & (MDBX_REVERSEKEY | MDBX_INTEGERKEY));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONSTEXPR_ENUM_FLAGS_OPERATIONS
|
MDBX_CXX11_CONSTEXPR_ENUM mdbx::value_mode
|
||||||
MDBX_CXX11_CONSTEXPR
|
map_handle::info::value_mode() const noexcept {
|
||||||
#endif
|
|
||||||
::mdbx::value_mode map_handle::info::value_mode() const noexcept {
|
|
||||||
return ::mdbx::value_mode(flags & (MDBX_DUPSORT | MDBX_REVERSEDUP |
|
return ::mdbx::value_mode(flags & (MDBX_DUPSORT | MDBX_REVERSEDUP |
|
||||||
MDBX_DUPFIXED | MDBX_INTEGERDUP));
|
MDBX_DUPFIXED | MDBX_INTEGERDUP));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user