nkr
A C++20 library with a custom meta-programming language.
nkr::allocator Namespace Reference

Allocator types are used by other types to allocate and deallocate various kinds of memory. More...

Detailed Description

Allocator types are used by other types to allocate and deallocate various kinds of memory.

Unlike traditional C programming, allocator types by definition of nkr::generic::allocator_tr only have two functions, Allocate and Deallocate. The prior is the only function that actually needs to be used, because it's similar to C's realloc in that it will allocate, reallocate, and deallocate based on its arguments. Furthermore, allocators come in two varieties, shared and owned. The shared allocators have static methods whereas owned allocators have non-static methods.