4#ifndef CBM_ALGO_BASE_POD_ALLOCATOR_H
5#define CBM_ALGO_BASE_POD_ALLOCATOR_H
25 static_assert(std::is_standard_layout_v<T>,
"PODAllocator only works with types with standard layout");
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.
void deallocate(T *p_t, size_t)
bool operator==(const PODAllocator &) const
bool operator!=(const PODAllocator &) const
void construct(T *obj, Args &&... args)
T * allocate(size_t size)