29 #ifndef BIT_MEMORY_ALLOCATORS_NULL_ALLOCATOR_HPP 30 #define BIT_MEMORY_ALLOCATORS_NULL_ALLOCATOR_HPP 32 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 34 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 36 #include "detail/named_allocator.hpp" 38 #include "../utilities/allocator_info.hpp" 39 #include "../utilities/macros.hpp" 40 #include "../utilities/owner.hpp" 43 #include <type_traits> 68 using default_alignment = std::integral_constant<std::size_t,1>;
114 std::size_t offset = 0 ) noexcept;
121 void deallocate( owner<void*> p, std::size_t n ) noexcept;
132 bool owns(
const void* p )
const noexcept;
137 bool owns( std::nullptr_t )
const noexcept;
154 using named_null_allocator = detail::named_allocator<null_allocator>;
159 #include "detail/null_allocator.inl" null_allocator & operator=(null_allocator &&other) noexcept=default
Move-assigns a null_allocator from another allocator.
owner< void * > try_allocate(std::size_t size, std::size_t align, std::size_t offset=0) noexcept
Allocates a null pointer.
An allocator that only ever serves nullptr.
allocator_info info() const noexcept
Gets the info about this allocator.
null_allocator()=default
Default-constructs a null_allocator.
void deallocate(owner< void *> p, std::size_t n) noexcept
Deallocates a pointer previously allocated with a call to allocate.
bool owns(const void *p) const noexcept
Checks if the pointer p is contained in the null_allocator.
This type is used to hold the generic information for a given allocator.