Skip to content

Owners: propose stack_array and dyn_array #1215

@MatthewBeshay

Description

@MatthewBeshay

Summary
Propose adding two Owners listed in the README as not yet implemented: stack_array and dyn_array. Goal is a minimal, idiomatic implementation that interoperates with gsl::span and follows the C++ Core Guidelines intent.

Motivation
The README’s Supported features - Owners section lists:

  • stack_array - a stack-allocated array
  • dyn_array - a heap-allocated array
    This issue asks for confirmation that the project would like these implemented here, and for guidance on a minimal surface area.

Proposed scope (sketch)

  • gsl::stack_array<T, N>
    • Fixed-size owner; provides data(), size(), begin(), end(), operator[], at().
    • Interop with span via gsl::span{arr} and/or a view() helper.
  • gsl::dyn_array
    • RAII owner for T[] with data(), size(), begin(), end(), operator[], at().
    • Movable; not resizable to keep scope small.
    • Interop with span as above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: BlockedCannot proceed due to external factors

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions