mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-30 22:47:16 +08:00
mdbx++: fix static_assertion slice::slice(text).
Change-Id: Id77d6064461becd4a9d8e2b914d39217f7a3b575
This commit is contained in:
parent
b1d21d571f
commit
4a9c387519
3
mdbx.h++
3
mdbx.h++
@ -396,8 +396,7 @@ struct LIBMDBX_API_TYPE slice : public ::MDBX_val {
|
|||||||
template <size_t SIZE>
|
template <size_t SIZE>
|
||||||
MDBX_CXX14_CONSTEXPR slice(const char (&text)[SIZE]) noexcept
|
MDBX_CXX14_CONSTEXPR slice(const char (&text)[SIZE]) noexcept
|
||||||
: slice(text, SIZE - 1) {
|
: slice(text, SIZE - 1) {
|
||||||
static_assert(SIZE > 0 && text[SIZE - 1] == '\0',
|
MDBX_CONSTEXPR_ASSERT(SIZE > 0 && text[SIZE - 1] == '\0');
|
||||||
"Must be a null-terminated C-string");
|
|
||||||
}
|
}
|
||||||
/// \brief Create a slice that refers to c_str[0,strlen(c_str)-1].
|
/// \brief Create a slice that refers to c_str[0,strlen(c_str)-1].
|
||||||
explicit MDBX_CXX17_CONSTEXPR slice(const char *c_str);
|
explicit MDBX_CXX17_CONSTEXPR slice(const char *c_str);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user