30 #ifndef BIT_MEMORY_ADAPTERS_ALLOCATOR_DELETER_HPP 31 #define BIT_MEMORY_ADAPTERS_ALLOCATOR_DELETER_HPP 33 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 35 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 37 #include "../utilities/ebo_storage.hpp" 38 #include "../utilities/pointer_utilities.hpp" 40 #include "../concepts/AllocatorStorage.hpp" 42 #include "../traits/allocator_traits.hpp" 46 #include <type_traits> 72 template<
typename T,
typename AllocatorStorage>
77 using allocator_type =
typename AllocatorStorage::allocator_type;
80 using pointer_traits = std::pointer_traits<typename alloc_traits::pointer>;
82 static_assert( !std::is_reference<T>::value,
"Unable to delete reference type" );
83 static_assert( !std::is_const<T>::value,
"Unable to delete const type" );
85 "AllocatorStorage must satisfy AllocatorStorage requirements" );
92 using void_pointer =
typename alloc_traits::pointer;
93 using pointer =
typename pointer_traits::template rebind<T>;
94 using size_type =
typename alloc_traits::size_type;
95 using difference_type =
typename alloc_traits::difference_type;
145 template<
typename T,
typename AllocatorStorage>
150 using allocator_type =
typename AllocatorStorage::allocator_type;
153 using pointer_traits = std::pointer_traits<typename alloc_traits::pointer>;
160 using void_pointer =
typename alloc_traits::pointer;
161 using pointer =
typename pointer_traits::template rebind<T>;
162 using size_type =
typename alloc_traits::size_type;
163 using difference_type =
typename alloc_traits::difference_type;
222 #include "detail/allocator_deleter.inl" Type trait to determine whether T is a AllocatorStorage.
The allocator_traits class template provides a standardized way to access allocator functionality...
allocator_deleter & operator=(allocator_deleter &&other) noexcept=default
Move-assigns an allocator_deleter from an existing one.
A deleter for custom allocators in the library.
void operator()(pointer p)
Deletes the underlying pointer p.
allocator_deleter(AllocatorStorage storage)
Constructs an allocator_deleter that uses the referenced allocator for deletion.
A utility class used for leveraging empty-base optimization for a generic sequence of types...