JPL Spatial
Sound spatialization and propagation library
Loading...
Searching...
No Matches
JPL::AllocatorDeleter< T, AllocatorType > Struct Template Reference

#include <JPLSpatial/Memory/Memory.h>

Public Types

using AForT = typename std::allocator_traits< AllocatorType >::template rebind_alloc< T >
 
using Traits = std::allocator_traits< AForT >
 

Public Member Functions

 AllocatorDeleter () noexcept(std::is_nothrow_default_constructible_v< AForT >)=default
 
 AllocatorDeleter (const AllocatorType &allocator) noexcept(std::is_nothrow_constructible_v< AForT, const AllocatorType & >)
 
 AllocatorDeleter (const AForT &allcoator) noexcept(std::is_nothrow_copy_constructible_v< AForT >)
 
JPL_INLINE void operator() (T *ptr) noexcept
 

Detailed Description

template<class T, class AllocatorType = std::allocator<T>>
struct JPL::AllocatorDeleter< T, AllocatorType >

A simple deleter to be used for std::unique_ptr and alike, that uses custom allocator, which must match the allocator used to allocate memory for the object.

Member Typedef Documentation

◆ AForT

template<class T , class AllocatorType = std::allocator<T>>
using JPL::AllocatorDeleter< T, AllocatorType >::AForT = typename std::allocator_traits<AllocatorType>::template rebind_alloc<T>

◆ Traits

template<class T , class AllocatorType = std::allocator<T>>
using JPL::AllocatorDeleter< T, AllocatorType >::Traits = std::allocator_traits<AForT>

Constructor & Destructor Documentation

◆ AllocatorDeleter() [1/3]

template<class T , class AllocatorType = std::allocator<T>>
JPL::AllocatorDeleter< T, AllocatorType >::AllocatorDeleter ( ) const
defaultnoexcept

◆ AllocatorDeleter() [2/3]

template<class T , class AllocatorType = std::allocator<T>>
JPL::AllocatorDeleter< T, AllocatorType >::AllocatorDeleter ( const AllocatorType &  allocator)
inlineexplicitnoexcept

◆ AllocatorDeleter() [3/3]

template<class T , class AllocatorType = std::allocator<T>>
JPL::AllocatorDeleter< T, AllocatorType >::AllocatorDeleter ( const AForT allcoator)
inlineexplicitnoexcept

Member Function Documentation

◆ operator()()

template<class T , class AllocatorType = std::allocator<T>>
JPL_INLINE void JPL::AllocatorDeleter< T, AllocatorType >::operator() ( T *  ptr)
inlinenoexcept

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