![]() |
ezEngine
Release 25.03
|
Helper function to facilitate setting the allocator on member containers of a class Allocators can be either template arguments or a ctor parameter. Using the ctor parameter requires the class ctor to reference each member container in the initialization list. This can be very tedious. On the other hand, the template variant only support template parameter so you can't simply pass in a member allocator. This class solves this problem provided the following rules are followed: More...
#include <AllocatorWrapper.h>
Public Member Functions | |
ezLocalAllocatorWrapper (ezAllocator *pAllocator) | |
void | Reset () |
Static Public Member Functions | |
static ezAllocator * | GetAllocator () |
Helper function to facilitate setting the allocator on member containers of a class Allocators can be either template arguments or a ctor parameter. Using the ctor parameter requires the class ctor to reference each member container in the initialization list. This can be very tedious. On the other hand, the template variant only support template parameter so you can't simply pass in a member allocator. This class solves this problem provided the following rules are followed:
ezAllocator
must be the declared at the earliest in the class, before any container.ezLocalAllocatorWrapper
should be declared right afterwards.ezLocalAllocatorWrapper
as a template argument to the allocator.