cds
2.3.2
|
Pool allocator adapter. More...
#include <cds/memory/pool_allocator.h>
Pool allocator adapter.
This class is an adapter for an object pool. It gives std::allocator
interface for the pool.
Template arguments:
T
- value typeAccessor
- a functor to access to the pool object. The pool has the following interface: Usage
Suppose, we have a pool with interface above. Usually, the pool is a static object:
The pool_allocator
gives std::allocator
interface for the pool. It is needed to declare an accessor functor to access to thePool:
Now, cds::memory::pool_allocator< T, pool_accessor >
can be used instead of std::allocator
.