C++ Logo


Advanced search

[std-proposals] Structured bindings for std::extents

From: Bernhard Manfred Gruber <bernhardmgruber_at_[hidden]>
Date: Mon, 20 Mar 2023 23:18:54 +0100

A colleague and I were playing around with `std::mdspan` and struggled
to define generic algorithms that would work on mdspans of any
dimension. We quickly needed the usual `std::make_index_sequence` etc.
to iterate over the `std::extents` and the code was "not nice". The
ergonomics would improve dramatically if we could somehow turn the
`std::extents` directly into a pack of values. With P1061 (Structured
Bindings can introduce a Pack), the only missing piece would be
structured bindings on `std::extents`, which is what I would like to
propose, backed by encouragement from some mdspan authors.

Please find a corresponding draft with a small discussion attached. I
am mainly looking for a first round of feedback, encouraging me to
pursue this idea and get a paper number.

Thank you for your feedback!
Bernhard Manfred Gruber

Received on 2023-03-20 22:19:06