This repository contains a thread-safe header-only stackfull object pool under 'StackfullObjectPool/StackfullObjectPool.hpp'.
For some toy examples look at 'StackfullObjectPool/StackfullObjectPoolTests.cpp'.
NOTE #1: The pool is meant to store only Trivially Copyable types, and it is enforced by a concept. Hence it's appropriate to use it to store Plain Old Data types (PODs) and the likes.
NOTE #2: A trivially copyable type must have a Trivial Destructor, hence the destructor of the pool's objects is never called upon releasing them. Rather the bytes used to store the object are overwritten and reused.
NOTE #3: The pool-objects type need not define a default constructor.
NOTE #4: The pool's lifetime must exceed that of its objects, otherwise it'll lead to undefined behavior.
The pool items' allocation and deallocation is managed using std::unique_ptr.
Under the hood, the pool is implemented using std::array of std::byte.
The next open slot in the pool is managed using a stack.