boost::capy::buffer_array

A buffer sequence holding up to N buffers.

Synopsis

template<
    std::size_t N,
    bool IsConst>
class buffer_array;

Description

This class template stores a fixed‐capacity array of buffer descriptors, where the actual count can vary from 0 to N. It provides efficient storage for small buffer sequences without dynamic allocation.

Usage

void process(ConstBufferSequence auto const& buffers)
{
    const_buffer_array<4> bufs(buffers);
    // use bufs.begin(), bufs.end(), bufs.to_span()
}

Types

Name

Description

value_type

The type of buffer stored in the array.

Member Functions

Name

Description

buffer_array [constructor]

Constructors

~buffer_array [destructor]

Destructor.

operator=

Copy assignment.

begin

Return an iterator to the beginning.

end

Return an iterator to the end.

to_span

Return a span of the buffers.

operator std::span<value_type>

Conversion to mutable span.

operator std::span<value_type const>

Conversion to const span.

Data Members

Name

arr_ [variant member]

dummy_ [variant member]

Friends

Name Description

boost::capy::tag_invoke

Slice customization point.

boost::capy::tag_invoke

Return the total byte count in O(1).

Template Parameters

Name Description

N

Maximum number of buffers the array can hold.

IsConst

If true, holds const_buffer; otherwise mutable_buffer.

Created with MrDocs