absl::chunked_queue

A queue implemented as a linked list of fixed or variable sized blocks.

Synopsis

Declared in <absl/container/chunked_queue.h>

template<
    typename T,
    size_t BLo = 0,
    size_t BHi = BLo,
    typename Allocator = std::allocator<T>>
class chunked_queue;

Description

absl::chunked_queue provides the same interface as std::deque minus random access. It is useful when memory usage is paramount as it provides finegrained and configurable block sizing.

Type Aliases

NameDescription
allocator_type The allocator type.
const_iterator A const forward iterator over the elements.
const_reference A const reference to an element.
difference_type A signed integer type used for iterator differences.
iterator A forward iterator over the elements.
reference A reference to an element.
size_type An unsigned integer type used for sizes.
value_type The type of the elements stored in the queue.

Member Functions

NameDescription
chunked_queue [constructor]Constructors
~chunked_queue [destructor]Destroys the queue and frees all allocated storage.
operator= Assignment operators
assign assign overloads
back back overloads
begin begin overloads
cbegin Returns a const iterator to the first element.
cend Returns a const iterator past the last element.
clear Erases all elements from the container.
emplace_back Appends a new element to the end of the container.
empty Returns true if the queue contains no elements.
end end overloads
front front overloads
get_allocator Returns the allocator associated with the container.
max_size Returns the maximum number of elements the queue is able to hold.
pop_front Removes the first element of the container.
push_back Appends the given element value to the end of the container.
resize Resizes the container to contain new_size elements.
shrink_to_fit Requests the removal of unused capacity.
size Returns the number of elements in the queue.
swap Swaps the contents of this queue with other.

Static Data Members

NameDescription
kBlockSizeMax The maximum block size, in elements.
kBlockSizeMin The minimum block size, in elements.

Non-Member Functions

NameDescription
swapSwaps the contents of two absl::chunked_queue containers.