carb::Deleter

Defined in carb/Memory.h

template<class T>
class Deleter

Allocated object deleter helper class.

This is suitable for use in various STL container classes that accept a functor responsible for deleting an object that was allocated using an allocation system other than new/delete. This particular implementation ensures the object is destructed before deallocating its memory.

Public Functions

inline void operator()(T *p) noexcept

Functor operator to destruct and deallocate an object that was allocated and constructed using one of the carb::allocate() family of functions.

Template Parameters

T – The data type of the object to delete.

Parameters

p[in] The object to be destroyed.