mn::memory::basic_deleter< Type, TAllocator > Class Template Reference

A Simple template for a deleter. More...

#include <mn_basic_deleter.hpp>

+ Inheritance diagram for mn::memory::basic_deleter< Type, TAllocator >:

Public Types

using value_type = Type
 
using allocator = TAllocator
 
using pointer = TAllocator *
 
using reference = TAllocator &
 

Public Member Functions

constexpr basic_deleter ()
 Construct a basic deleter. More...
 
constexpr basic_deleter (reference alloc, size_t) noexcept
 Construt a basic deleter. More...
 
template<typename U , typename = typename enable_if<is_convertible<U*,value_type*>::value>::type>
 basic_deleter (const basic_deleter< U, TAllocator > &other) noexcept
 Converting constructor. Allows conversion from a deleter for arrays of another type, U, only if U* is convertible to value_type*. More...
 
bool is_valid () const noexcept
 Is the deleter valid - have a allocator. More...
 
reference get_allocator ()
 Get a reference from the using allocator. More...
 
void set_allocator (reference alloc) noexcept
 Set the using allocator for delete. More...
 
void operator() (value_type *pP) noexcept
 Calls deallocate pArray. More...
 

Private Attributes

pointer m_refAllocator
 

Detailed Description

template<typename Type, class TAllocator>
class mn::memory::basic_deleter< Type, TAllocator >

A Simple template for a deleter.

Template Parameters
TypeThe type of pointer to delete.
TAllocatorThe using allocator for call deallocate

Member Typedef Documentation

◆ allocator

template<typename Type , class TAllocator >
using mn::memory::basic_deleter< Type, TAllocator >::allocator = TAllocator

◆ pointer

template<typename Type , class TAllocator >
using mn::memory::basic_deleter< Type, TAllocator >::pointer = TAllocator*

◆ reference

template<typename Type , class TAllocator >
using mn::memory::basic_deleter< Type, TAllocator >::reference = TAllocator&

◆ value_type

template<typename Type , class TAllocator >
using mn::memory::basic_deleter< Type, TAllocator >::value_type = Type

Constructor & Destructor Documentation

◆ basic_deleter() [1/3]

template<typename Type , class TAllocator >
constexpr mn::memory::basic_deleter< Type, TAllocator >::basic_deleter ( )
inlineconstexpr

Construct a basic deleter.

◆ basic_deleter() [2/3]

template<typename Type , class TAllocator >
constexpr mn::memory::basic_deleter< Type, TAllocator >::basic_deleter ( reference  alloc,
size_t   
)
inlineconstexprnoexcept

Construt a basic deleter.

Parameters
allocThe using allocator class

◆ basic_deleter() [3/3]

template<typename Type , class TAllocator >
template<typename U , typename = typename enable_if<is_convertible<U*,value_type*>::value>::type>
mn::memory::basic_deleter< Type, TAllocator >::basic_deleter ( const basic_deleter< U, TAllocator > &  other)
inlinenoexcept

Converting constructor. Allows conversion from a deleter for arrays of another type, U, only if U* is convertible to value_type*.

Member Function Documentation

◆ get_allocator()

template<typename Type , class TAllocator >
reference mn::memory::basic_deleter< Type, TAllocator >::get_allocator ( )
inline

Get a reference from the using allocator.

Returns
The reference from the using allocator.

◆ is_valid()

template<typename Type , class TAllocator >
bool mn::memory::basic_deleter< Type, TAllocator >::is_valid ( ) const
inlinenoexcept

Is the deleter valid - have a allocator.

Returns
True when the deleter valid is and false if not.

◆ operator()()

template<typename Type , class TAllocator >
void mn::memory::basic_deleter< Type, TAllocator >::operator() ( value_type pP)
inlinenoexcept

Calls deallocate pArray.

◆ set_allocator()

template<typename Type , class TAllocator >
void mn::memory::basic_deleter< Type, TAllocator >::set_allocator ( reference  alloc)
inlinenoexcept

Set the using allocator for delete.

Parameters
allocThe reference of the using allocator.

Member Data Documentation

◆ m_refAllocator

template<typename Type , class TAllocator >
pointer mn::memory::basic_deleter< Type, TAllocator >::m_refAllocator
private

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