29 #ifndef BIT_MEMORY_ALLOCATORS_ALLOCATOR_REFERENCE_HPP 30 #define BIT_MEMORY_ALLOCATORS_ALLOCATOR_REFERENCE_HPP 32 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 34 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 36 #include "../utilities/owner.hpp" 37 #include "../utilities/allocator_info.hpp" 38 #include "../utilities/macros.hpp" 40 #include "../concepts/Allocator.hpp" 41 #include "../concepts/Stateless.hpp" 43 #include "../traits/allocator_traits.hpp" 46 #include <type_traits> 52 struct allocator_vtable;
77 using default_alignment = std::integral_constant<std::size_t,1>;
88 template<
typename Allocator,
89 typename = std::enable_if_t<is_allocator<std::decay_t<Allocator>>::value &&
90 !std::is_same<allocator_reference,std::decay_t<Allocator>>::value>>
127 owner<void*> try_allocate( std::size_t size, std::size_t align ) noexcept;
134 owner<void*> allocate( std::size_t size, std::size_t align );
141 void deallocate( owner<void*> p, std::size_t n );
158 using vtable_type = detail::allocator_vtable;
160 template<
typename Allocator>
161 struct stateless_type;
172 template<
typename Allocator>
181 const vtable_type* m_vtable;
206 template<
typename StatelessAllocator>
212 #include "detail/allocator_reference.inl"
This type is used to hold the generic information for a given allocator.
A non-owning allocator type that type-erases an underlying allocator.