4#ifndef CBM_ALGO_BASE_POD_ALLOCATOR_H
5#define CBM_ALGO_BASE_POD_ALLOCATOR_H
25 static_assert(!std::is_polymorphic_v<T>,
"PODAllocator only works with types with non-polymorphic types");
32 template<
class... Args>
33 void construct([[maybe_unused]] T* obj, Args&&... args)
35 if constexpr (
sizeof...(args) > 0)
new (obj) T(std::forward<Args>(args)...);
static constexpr size_t size()
Allocator for plain old data types.
bool operator!=(const PODAllocator &) const
T * allocate(size_t size)
bool operator==(const PODAllocator &) const
void deallocate(T *p_t, size_t)
void construct(T *obj, Args &&... args)