Lumiera  0.pre.03
»edit your freedom«
UniqueMallocOwner< X > Class Template Reference

#include "lib/unique-malloc-owner.hpp"

Description

template<class X = void>
class lib::UniqueMallocOwner< X >

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.

Remarks
std::free is installed as deleter function, which means we're carrying along an additional pointer

Definition at line 57 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 *)>
 
+ Inheritance diagram for UniqueMallocOwner< X >:
+ Collaboration diagram for UniqueMallocOwner< X >:

The documentation for this class was generated from the following file: