23 #ifndef INCLUDED_STL_ALLOCATORS 24 #define INCLUDED_STL_ALLOCATORS 27 #include <type_traits> 33 template<
typename T,
class Backend>
36 template<
typename A,
class B>
60 return static_cast<T*
>(
allocator->allocate(n *
sizeof(
T),
nullptr,
alignof(
T)));
65 return allocator->deallocate(static_cast<void*>(ptr), n *
sizeof(
T));
77 template<
typename T,
class Backend>
80 template<
typename A,
class B>
104 return static_cast<T*
>(
allocator.allocate(n *
sizeof(
T),
nullptr,
alignof(
T)));
109 return allocator.deallocate(static_cast<void*>(ptr), n *
sizeof(
T));
116 #endif // INCLUDED_STL_ALLOCATORS T * pointer
Definition: STLAllocators.h:84
T value_type
Definition: STLAllocators.h:83
Definition: STLAllocators.h:53
T * pointer
Definition: STLAllocators.h:40
Adapt a 0 A.D.
Definition: STLAllocators.h:34
Definition: ShaderDefines.cpp:30
STLAllocator(const STLAllocator< V, Backend > &proxy)
Definition: STLAllocators.h:48
std::false_type is_always_equal
Definition: STLAllocators.h:85
Definition: STLAllocators.h:97
std::false_type is_always_equal
Definition: STLAllocators.h:41
void deallocate(T *ptr, const size_t n)
Definition: STLAllocators.h:63
T * allocate(size_t n)
Definition: STLAllocators.h:102
#define T(string_literal)
Definition: secure_crt.cpp:77
void deallocate(T *ptr, const size_t n)
Definition: STLAllocators.h:107
Backend
Definition: Backend.h:27
STLAllocator()
Definition: STLAllocators.h:43
ProxyAllocator(const ProxyAllocator< V, Backend > &proxy)
Definition: STLAllocators.h:92
Proxies allocation to another allocator.
Definition: STLAllocators.h:78
T * allocate(size_t n)
Definition: STLAllocators.h:58
T value_type
Definition: STLAllocators.h:39
Backend & allocator
Definition: STLAllocators.h:113
std::shared_ptr< Backend > allocator
Definition: STLAllocators.h:69
ProxyAllocator(Backend &alloc)
Definition: STLAllocators.h:87