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
-
Type The type of pointer to delete. TAllocator The 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 >
|
inlineconstexpr |
Construct a basic deleter.
◆ basic_deleter() [2/3]
template<typename Type , class TAllocator >
|
inlineconstexprnoexcept |
Construt a basic deleter.
- Parameters
-
alloc The 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>
|
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 >
|
inline |
Get a reference from the using allocator.
- Returns
- The reference from the using allocator.
◆ is_valid()
template<typename Type , class TAllocator >
|
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 >
|
inlinenoexcept |
Calls deallocate
pArray
.
◆ set_allocator()
template<typename Type , class TAllocator >
|
inlinenoexcept |
Set the using allocator for delete.
- Parameters
-
alloc The reference of the using allocator.
Member Data Documentation
◆ m_refAllocator
template<typename Type , class TAllocator >
|
private |
The documentation for this class was generated from the following file: