![]() |
Lumiera 0.pre.04~rc.1
»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 *)> |
|
inlineexplicit |
Definition at line 55 of file unique-malloc-owner.hpp.
|
inlineexplicit |
Definition at line 60 of file unique-malloc-owner.hpp.
|
private |
Definition at line 51 of file unique-malloc-owner.hpp.
|
inline |
Definition at line 66 of file unique-malloc-owner.hpp.
Inheritance diagram for UniqueMallocOwner< X >:
Collaboration diagram for UniqueMallocOwner< X >: