Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/unique-malloc-owner.hpp"
Ownership token for a piece of heap memory allocated in plain-C style.
This smart ptr takes ownership of the memory given at construction, to make sure it is deallocated properly with free(void*)
. Ownership can be transferred by move semantics.
std::free
is installed as deleter function, which means we're carrying along an additional pointer Definition at line 48 of file unique-malloc-owner.hpp.
Public Member Functions | |
UniqueMallocOwner (void *memory=nullptr) | |
UniqueMallocOwner (X *alloc) | |
bool | empty () const |
Private Types | |
using | _Parent = std::unique_ptr< X, void(*)(void *)> |