MakeAllocator Class
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at MakeAllocator Class.
Supports the WRL infrastructure and is not intended to be used directly from your code.
template<
typename T,
bool hasWeakReferenceSupport =
!__is_base_of(RuntimeClassFlags<InhibitWeakReference>,
T)> , T)> class MakeAllocator;
template<
typename T
>
class MakeAllocator<T, false>;
template<
typename T
>
class MakeAllocator<T, true>;
Parameters
T
A type name.
hasWeakReferenceSupporttrue to allocate memory for an object that supports weak references; false to allocate memory for an object that doesn't support weak references.
Allocates memory for an activatable class, with or without weak reference support.
Override the MakeAllocator class to implement a user-defined memory allocation model.
MakeAllocator is typically used to prevent memory leaks if an object throws during construction.
Public Constructors
| Name | Description |
|---|---|
| MakeAllocator::MakeAllocator Constructor | Initializes a new instance of the MakeAllocator class. |
| MakeAllocator::~MakeAllocator Destructor | Deinitializes the current instance of the MakeAllocator class. |
Public Methods
| Name | Description |
|---|---|
| MakeAllocator::Allocate Method | Allocates memory and associates it with the current MakeAllocator object. |
| MakeAllocator::Detach Method | Disassociates memory allocated by the Allocate method from the current MakeAllocator object. |
MakeAllocator
Header: implements.h
Namespace: Microsoft::WRL::Details