vecmem 1.14.0
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | List of all members
vecmem::details::unique_alloc_deleter< T > Struct Template Reference

A deleter class for trivial allocations. More...

#include <vecmem/memory/details/unique_alloc_deleter.hpp>

Public Member Functions

 unique_alloc_deleter (void)=default
 Default-construct a new unique allocation deleter.
 
 unique_alloc_deleter (memory_resource &mr, std::size_t s, std::size_t a=0)
 Construct a new unique allocation deleter.
 
 unique_alloc_deleter (const unique_alloc_deleter &i)=default
 Copy a unique allocation deleter.
 
 unique_alloc_deleter (unique_alloc_deleter &&i)=default
 Move a unique allocation deleter.
 
unique_alloc_deleteroperator= (const unique_alloc_deleter &i)=default
 Copy-assign a unique allocation deleter.
 
unique_alloc_deleteroperator= (unique_alloc_deleter &&i)=default
 Move-assign a unique allocation deleter.
 
void operator() (void *p) const
 Activate the deletion mechanism of the deleter.
 

Detailed Description

template<typename T>
struct vecmem::details::unique_alloc_deleter< T >

A deleter class for trivial allocations.

This class provides all the necessary functionality to allow unique pointers to deallocate allocations of trivial types, as well as arrays of them.

Template Parameters
TThe type to deallocate.
Note
This deleter class supports non-array types, array types of unknown bound, but not array types of known bound.
This deleter class only supports types that are both trivially constructible and trivially destructible.

Constructor & Destructor Documentation

◆ unique_alloc_deleter() [1/4]

template<typename T >
vecmem::details::unique_alloc_deleter< T >::unique_alloc_deleter ( void  )
default

Default-construct a new unique allocation deleter.

This constructor should only really be used in cases where we are nulling a unique pointer.

◆ unique_alloc_deleter() [2/4]

template<typename T >
vecmem::details::unique_alloc_deleter< T >::unique_alloc_deleter ( memory_resource &  mr,
std::size_t  s,
std::size_t  a = 0 
)
inline

Construct a new unique allocation deleter.

This is the standard constructor for this class, which stores all the necessary data to deallocate an allocation.

Parameters
mrThe memory resource to use for deallocation.
pThe pointer to deallocate.
sThe size of the allocation.
aThe alignment of the allocation.

◆ unique_alloc_deleter() [3/4]

template<typename T >
vecmem::details::unique_alloc_deleter< T >::unique_alloc_deleter ( const unique_alloc_deleter< T > &  i)
default

Copy a unique allocation deleter.

Parameters
iThe allocation deleter to copy.

◆ unique_alloc_deleter() [4/4]

template<typename T >
vecmem::details::unique_alloc_deleter< T >::unique_alloc_deleter ( unique_alloc_deleter< T > &&  i)
default

Move a unique allocation deleter.

Parameters
iThe allocation deleter to move.

Member Function Documentation

◆ operator()()

template<typename T >
void vecmem::details::unique_alloc_deleter< T >::operator() ( void p) const
inline

Activate the deletion mechanism of the deleter.

Parameters
pThe pointer to deallocate.

◆ operator=() [1/2]

Copy-assign a unique allocation deleter.

Parameters
iThe object to copy into the current one.
Returns
A reference to this object.

◆ operator=() [2/2]

Move-assign a unique allocation deleter.

Parameters
iThe object to move into the current one.
Returns
A reference to this object.

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