Skip to content

New container: chunked_vector #274

@HDembinski

Description

@HDembinski

For Boost.Histogram, I need a new type of container. I plan to implement a private version to keep histogram decoupled from Boost.Container, but I wanted to propose this type of container for Boost.Container.

The container should store chunks of homogenous types with fixed length, which is defined at runtime, not compile time.

The container is internally implemented like std::vector, memory is contiguous. The element of the container is not a single value, but a chunk of values with fixed size, which is defined at runtime when the container is created. The value type of the container should be static_vector or small_vector, while its reference types should based on boost::span.

Basically, this is a much more efficient version of std::vector<std::vector<T>> for the case when you know that the inner vector will always have same length, but you don't know this length at compile-time, so you cannot use std::vector<std::array<T, N>>.

I tentatively call this chunked_vector, but I hope you come up with a better name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions