mdbx++: rename default_allocator to legacy_allocator.

Change-Id: I48118a9424be3063b916c00c73715aed4e244ac8
This commit is contained in:
Leonid Yuriev 2020-09-01 13:28:29 +03:00
parent 883c9f960c
commit 500609736c
2 changed files with 12 additions and 12 deletions

View File

@ -210,13 +210,13 @@ class txn;
class cursor_ref; class cursor_ref;
class cursor; class cursor;
using default_allocator = ::std::string::allocator_type; using legacy_allocator = ::std::string::allocator_type;
#if defined(DOXYGEN) || \ #if defined(DOXYGEN) || \
defined(__cpp_lib_memory_resource) && __cpp_lib_memory_resource >= 201603L defined(__cpp_lib_memory_resource) && __cpp_lib_memory_resource >= 201603L
using polymorphic_allocator = ::std::pmr::string::allocator_type; using polymorphic_allocator = ::std::pmr::string::allocator_type;
#endif /* __cpp_lib_memory_resource >= 201603L */ #endif /* __cpp_lib_memory_resource >= 201603L */
template <class ALLOCATOR = default_allocator> template <class ALLOCATOR = legacy_allocator>
using string = ::std::basic_string<char, ::std::char_traits<char>, ALLOCATOR>; using string = ::std::basic_string<char, ::std::char_traits<char>, ALLOCATOR>;
using filehandle = ::mdbx_filehandle_t; using filehandle = ::mdbx_filehandle_t;
@ -469,7 +469,7 @@ struct LIBMDBX_API_TYPE slice : public ::MDBX_val {
#endif /* __cpp_lib_string_view >= 201606L */ #endif /* __cpp_lib_string_view >= 201606L */
template <class C = char, class T = ::std::char_traits<C>, template <class C = char, class T = ::std::char_traits<C>,
class A = default_allocator> class A = legacy_allocator>
cxx20_constexpr ::std::basic_string<C, T, A> cxx20_constexpr ::std::basic_string<C, T, A>
string(const A &allocator = A()) const { string(const A &allocator = A()) const {
static_assert(sizeof(C) == 1, "Must be single byte characters"); static_assert(sizeof(C) == 1, "Must be single byte characters");
@ -516,25 +516,25 @@ struct LIBMDBX_API_TYPE slice : public ::MDBX_val {
return (length() + 3) / 4 * 3; return (length() + 3) / 4 * 3;
} }
template <class ALLOCATOR = default_allocator> template <class ALLOCATOR = legacy_allocator>
inline ::mdbx::string<ALLOCATOR> inline ::mdbx::string<ALLOCATOR>
hex_encode(bool uppercase = false, hex_encode(bool uppercase = false,
const ALLOCATOR &allocator = ALLOCATOR()) const; const ALLOCATOR &allocator = ALLOCATOR()) const;
template <class ALLOCATOR = default_allocator> template <class ALLOCATOR = legacy_allocator>
inline ::mdbx::string<ALLOCATOR> inline ::mdbx::string<ALLOCATOR>
hex_decode(const ALLOCATOR &allocator = ALLOCATOR()) const; hex_decode(const ALLOCATOR &allocator = ALLOCATOR()) const;
template <class ALLOCATOR = default_allocator> template <class ALLOCATOR = legacy_allocator>
inline ::mdbx::string<ALLOCATOR> inline ::mdbx::string<ALLOCATOR>
base58_encode(const ALLOCATOR &allocator = ALLOCATOR()) const; base58_encode(const ALLOCATOR &allocator = ALLOCATOR()) const;
template <class ALLOCATOR = default_allocator> template <class ALLOCATOR = legacy_allocator>
inline ::mdbx::string<ALLOCATOR> inline ::mdbx::string<ALLOCATOR>
base58_decode(const ALLOCATOR &allocator = ALLOCATOR()) const; base58_decode(const ALLOCATOR &allocator = ALLOCATOR()) const;
template <class ALLOCATOR = default_allocator> template <class ALLOCATOR = legacy_allocator>
inline ::mdbx::string<ALLOCATOR> inline ::mdbx::string<ALLOCATOR>
base64_encode(const ALLOCATOR &allocator = ALLOCATOR()) const; base64_encode(const ALLOCATOR &allocator = ALLOCATOR()) const;
template <class ALLOCATOR = default_allocator> template <class ALLOCATOR = legacy_allocator>
inline ::mdbx::string<ALLOCATOR> inline ::mdbx::string<ALLOCATOR>
base64_decode(const ALLOCATOR &allocator = ALLOCATOR()) const; base64_decode(const ALLOCATOR &allocator = ALLOCATOR()) const;
@ -627,7 +627,7 @@ protected:
/// Container of a value, which could be stored inside internal silo /// Container of a value, which could be stored inside internal silo
/// or be a reference to an external stored one. /// or be a reference to an external stored one.
template <class ALLOCATOR = default_allocator> class buffer { template <class ALLOCATOR = legacy_allocator> class buffer {
friend class txn_ref; friend class txn_ref;
using silo = ::mdbx::string<ALLOCATOR>; using silo = ::mdbx::string<ALLOCATOR>;
silo silo_; silo silo_;
@ -1043,7 +1043,7 @@ public:
} }
template <class C = char, class T = ::std::char_traits<C>, template <class C = char, class T = ::std::char_traits<C>,
class A = default_allocator> class A = legacy_allocator>
cxx20_constexpr ::std::basic_string<C, T, A> cxx20_constexpr ::std::basic_string<C, T, A>
string(const A &allocator = A()) const { string(const A &allocator = A()) const {
return slice_.string<C, T, A>(allocator); return slice_.string<C, T, A>(allocator);

View File

@ -1005,7 +1005,7 @@ bool slice::is_base64(bool ignore_spaces) const noexcept {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
template class LIBMDBX_API_TYPE buffer<default_allocator>; template class LIBMDBX_API_TYPE buffer<legacy_allocator>;
#if defined(__cpp_lib_memory_resource) && __cpp_lib_memory_resource >= 201603L #if defined(__cpp_lib_memory_resource) && __cpp_lib_memory_resource >= 201603L
template class LIBMDBX_API_TYPE buffer<polymorphic_allocator>; template class LIBMDBX_API_TYPE buffer<polymorphic_allocator>;