Skip to content

Introduce a span class in the codebase #3219

@daljit46

Description

@daljit46

While working on my GPU-based registration code, I found it very useful to use std::span, a C++20 view into contiguous containers. This is very useful in functions which need to operate on a contiguous section of memory, regardless of the underlying container (e.g. std::array, std::initializer_list, std::vector or something else).
I think we should introduce this into our codebase. The motivation is similar in spirit to #3212. std::span is available with C++20 and onwards, but there are other API compatible implementations like tcb::span that work with C++17. Once we upgrade to C++20, it would be mostly a case of substituting the namespace tcb with std (we could even use an alias if wanted, with something like namespace std { using tcb::span; }).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions