moved to allocator_base

This commit is contained in:
cyborg1811m 2024-01-22 22:43:06 +01:00
parent 12ff94e6cc
commit 8170507158
1 changed files with 5 additions and 7 deletions

View File

@ -11,22 +11,20 @@
namespace cc { namespace cc {
template<typename T> template<typename T>
class allocator { class allocator_base {
public: public:
using value_type = T; using value_type = T;
using size_type = std::size_t; using size_type = std::size_t;
using difference_type = std::ptrdiff_t; using difference_type = std::ptrdiff_t;
[[nodiscard]] virtual constexpr T* allocate(size_type size) { [[nodiscard]] virtual constexpr T* allocate(size_type size) = 0;
throw std::bad_alloc();
}
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<void>; using statically_allocated = void;
} }
#endif //UDIFF_ALLOCATOR_H_ #endif //UDIFF_ALLOCATOR_H_