7 #include <boost/memory/memory_block.hpp> 8 #include <boost/memory/null_allocator.hpp> 10 #include <type_traits> 13 namespace boost {
namespace memory {
18 template <
typename type>
19 constexpr std::size_t size_of();
22 constexpr std::size_t size_of<void>();
24 template <
typename type>
25 void construct_at(memory_block& block, std::size_t offset);
28 void construct_at<void>(memory_block& block, std::size_t offset);
30 template <
typename type>
31 void destruct_at(memory_block& block, std::size_t offset);
34 void destruct_at<void>(memory_block& block, std::size_t offset);
43 template <
typename affix_allocator_type>
44 class affix_allocator_helper final
47 affix_allocator_helper(affix_allocator_type& instance);
49 auto& get_allocator();
52 affix_allocator_type& instance_;
74 typename suffix = void,
80 std::is_default_constructible<prefix>::value || std::is_same<prefix, void>::value,
81 "prefix has to be default constructible or void");
83 std::is_default_constructible<suffix>::value || std::is_same<suffix, void>::value,
84 "suffix has to be default constructible or void");
86 using allocator_type = allocator;
87 using prefix_type = prefix;
88 using suffix_type = suffix;
130 friend affix_allocator_helper<this_affix_allocator_type>;
132 static std::size_t size_of_allocation(std::size_t size) noexcept;
140 allocator allocator_;
145 #include "affix_allocator.ipp"
Allocator adding prefix and suffix objects in boundries of allocated block.
Represents an allocated memory block.