template<int MaxElementSize, int MaxSize>
bn::generic_pool class

Generic pool implementation that uses a fixed size buffer.

Template parameters
MaxElementSize Element size.
MaxSize Maximum number of elements that can be stored.

Base classes

template<int MaxElementSize>
class igeneric_pool<sizeof(generic_pool_element<MaxElementSize>)>
Base class of generic_pool.

Public types

using size_type = typename base_type::size_type
Size type alias.

Constructors, destructors, conversion operators

Default constructor.

Public functions

template<typename Type>
auto contains(const Type& value) const -> bool
Indicates if the given value belongs to the generic_pool or not.
template<typename Type, typename... Args>
auto create(Args && ... args) -> Type&
Constructs a value inside of the generic_pool.
template<typename Type>
void destroy(Type& value)
Destroys the given value, previously allocated with the create method.

Function documentation

template<int MaxElementSize, int MaxSize> template<typename Type, typename... Args>
Type& bn::generic_pool<MaxElementSize, MaxSize>::create(Args && ... args)

Constructs a value inside of the generic_pool.

Template parameters
Type Type of the value to construct.
Args Type of the arguments of the value to construct.
args Parameters of the value to construct.
Returns Reference to the new value.