Код: Выделить всё
#pragma once
#include
#include
template
class Allocator : public std::pmr::memory_resource {
private:
std::shared_ptr memory_pool;
std::shared_ptr free_index;
void* do_allocate(size_t bytes, size_t alignment) override;
void do_deallocate(void* p, size_t bytes, size_t alignment) override;
bool do_is_equal(const std::pmr::memory_resource& other) const noexcept override;
public:
Allocator();
~Allocator() noexcept = default;
};
Подробнее здесь: https://stackoverflow.com/questions/798 ... -allocator