共用方式為


freelist Class

Manages a list of memory blocks.

template <std::size_t Sz, class Max> class freelist
    : public Max

Parameters

Parameter

Description

Sz

The number of elements in the array to be allocated.

Max

The max class representing the maximum number of elements to be stored in the free list. The max class can be max_none, max_unbounded, max_fixed_size, or max_variable_size.

Remarks

This template class manages a list of memory blocks of size Sz with the maximum length of the list determined by the max class passed in Max.

Constructors

freelist

Constructs an object of type freelist.

Member Functions

pop

Removes the first memory block from the free list.

push

Adds a memory block to the list.

Requirements

Header: <allocators>

Namespace: stdext

See Also

Reference

<allocators>