From 81705071586a69217d3aa61e8ab7d93fde6fe36a Mon Sep 17 00:00:00 2001 From: cyborg1811m Date: Mon, 22 Jan 2024 22:43:06 +0100 Subject: [PATCH] moved to allocator_base --- include/allocator.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/include/allocator.h b/include/allocator.h index 3141899..9f93154 100644 --- a/include/allocator.h +++ b/include/allocator.h @@ -11,22 +11,20 @@ namespace cc { template - class allocator { + class allocator_base { public: using value_type = T; using size_type = std::size_t; using difference_type = std::ptrdiff_t; - [[nodiscard]] virtual constexpr T* allocate(size_type size) { - throw std::bad_alloc(); - } + [[nodiscard]] virtual constexpr T* allocate(size_type size) = 0; - virtual constexpr void deallocate(T*, size_type) {} + virtual constexpr void deallocate(T*, size_type) = 0; - [[nodiscard]] size_type max_size() { return 0; } + [[nodiscard]] size_type max_size() = 0; }; - using statically_allocated = allocator; + using statically_allocated = void; } #endif //UDIFF_ALLOCATOR_H_