6#ifndef NIM_CPP_WRAPPER_UTIL_JSON_ALLOCATOR_H_INCLUDED
7#define NIM_CPP_WRAPPER_UTIL_JSON_ALLOCATOR_H_INCLUDED
22 using const_pointer =
const T*;
24 using const_reference =
const T&;
25 using size_type = std::size_t;
26 using difference_type = std::ptrdiff_t;
33 return static_cast<pointer
>(::operator
new(n *
sizeof(T)));
44 std::memset(p, 0, n *
sizeof(T));
52 template <
typename... Args>
55 ::new (
static_cast<void*
>(p)) T(std::forward<Args>(args)...);
58 size_type max_size()
const {
return size_t(-1) /
sizeof(T); }
60 pointer address(reference x)
const {
return std::addressof(x); }
62 const_pointer address(const_reference x)
const {
return std::addressof(x); }
75 SecureAllocator(
const SecureAllocator<U>&) {}
82template <
typename T,
typename U>
87template <
typename T,
typename U>
88bool operator!=(
const SecureAllocator<T>&,
const SecureAllocator<U>&) {
Definition: allocator.h:17
pointer allocate(size_type n)
Definition: allocator.h:31
void construct(pointer p, Args &&... args)
Definition: allocator.h:53
void destroy(pointer p)
Definition: allocator.h:67
void deallocate(volatile pointer p, size_type n)
Definition: allocator.h:43
bool operator==(const NIMChatRoomExitReasonInfo &info, NIMChatRoomExitReason code)
Definition: nim_chatroom_helper.cpp:13
JSON (JavaScript Object Notation).
Definition: allocator.h:14
Definition: allocator.h:77