6 #ifndef CPPTL_JSON_ALLOCATOR_H_INCLUDED 7 #define CPPTL_JSON_ALLOCATOR_H_INCLUDED 30 return static_cast<pointer>(::operator
new(n *
sizeof(T)));
41 std::memset(p, 0, n *
sizeof(T));
49 template<
typename... Args>
52 ::new (static_cast<void*>(p)) T(std::forward<Args>(args)...);
56 return size_t(-1) /
sizeof(T);
60 return std::addressof(x);
64 return std::addressof(x);
82 template<
typename T,
typename U>
87 template<
typename T,
typename U>
94 #endif // CPPTL_JSON_ALLOCATOR_H_INCLUDED void construct(pointer p, Args &&...args)
Construct an item in-place at pointer P.
pointer address(reference x) const
const T & const_reference
const_pointer address(const_reference x) const
pointer allocate(size_type n)
Allocate memory for N items using the standard allocator.
SecureAllocator(const SecureAllocator< U > &)
void destroy(pointer p)
Destroy an item in-place at pointer P.
JSON (JavaScript Object Notation).
bool operator==(const SecureAllocator< T > &, const SecureAllocator< U > &)
size_type max_size() const
std::ptrdiff_t difference_type
bool operator!=(const SecureAllocator< T > &, const SecureAllocator< U > &)
void deallocate(volatile pointer p, size_type n)
Release memory which was allocated for N items at pointer P.