mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:04:12 +08:00
mdbx++: clarify comments for mdbx::byte
and char8_t
usage.
Related to https://github.com/erthink/libmdbx/issues/263.
This commit is contained in:
parent
75b23524bd
commit
03381fa469
10
mdbx.h++
10
mdbx.h++
@ -251,11 +251,15 @@ namespace mdbx {
|
|||||||
// Functions whose signature depends on the `mdbx::byte` type
|
// Functions whose signature depends on the `mdbx::byte` type
|
||||||
// must be strictly defined as inline!
|
// must be strictly defined as inline!
|
||||||
#if defined(DOXYGEN) || (defined(__cpp_char8_t) && __cpp_char8_t >= 201811)
|
#if defined(DOXYGEN) || (defined(__cpp_char8_t) && __cpp_char8_t >= 201811)
|
||||||
// Wanna using a non-aliasing type to release more power of an optimizer.
|
// To enable all kinds of an compiler optimizations we use a byte-like type
|
||||||
|
// that don't presumes aliases for pointers as does the `char` type and its
|
||||||
|
// derivatives/typedefs.
|
||||||
|
// Please see https://github.com/erthink/libmdbx/issues/263
|
||||||
|
// for reasoning of the use of `char8_t` type and switching to `__restrict__`.
|
||||||
using byte = char8_t;
|
using byte = char8_t;
|
||||||
#else
|
#else
|
||||||
// Wanna not using std::byte since it doesn't add features,
|
// Avoid `std::byte` since it doesn't add features but inconvenient
|
||||||
// but add inconvenient restrictions.
|
// restrictions.
|
||||||
using byte = unsigned char;
|
using byte = unsigned char;
|
||||||
#endif /* __cpp_char8_t >= 201811*/
|
#endif /* __cpp_char8_t >= 201811*/
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user