AUI Framework
develop
Cross-platform base for C++ UI apps
|
|
static |
T | any type. |
raw | raw pointer to manage memory of. |
|
static |
T | any type |
raw | raw pointer to manage memory of |
|
static |
T | any type |
Deleter | object implementing operator()(T*) |
raw | raw pointer to manage memory of |
deleter |
|
inlinestatic |
T | The type of the object to manage. |
Deleter | The type of the custom deleter function or functor. |
ptr | A raw pointer to the object that the unique pointer will manage. |
deleter | A custom deleter that will be used to destroy the managed object. |
Creates a unique pointer with a custom deleter.
unique_ptr
could not deduce T and Deleter by itself. Use this function to avoid this restriction. By using this function, the lifetime of the pointer is delegated to std::unique_ptr. Specified Deleter will free the wrapped pointer. The default deleter is std::default_delete. You may want to specialize std::default_delete<T>
struct to specify a default deleter for T, in this case you can omit the deleter argument of this function.
|
inlinestatic |
T | class which derived from a class that implements std::enable_shared_from_this . |
raw | pointer to the T class. |
std::enable_shared_from_this
provides a shared pointer to itself, however, if inheritance takes place, type is lost, requiring manual downcasting.
Downcasts std::enable_shared_from_this<base class>
to the derived class T
by the aliasing constructor of the shared pointer. This eliminates the need of expensive downcasting, maintaining memory safety.
|
inlinestatic |
T | class which derived from a class that implements std::enable_shared_from_this . |
raw | pointer to the T class. |
std::enable_shared_from_this
provides a shared pointer to itself, however, if inheritance takes place, type is lost, requiring manual downcasting.
Downcasts std::enable_shared_from_this<base class>
to the derived class T
by the aliasing constructor of the shared pointer. This eliminates the need of expensive downcasting, maintaining memory safety.
Contents