P3242R2 — Copy and fill for mdspan
Nicolas Morales, Christian Trott, Mark Hoemmen, Damien Lebrun-Grandie
LWG
Revisions R4Jul 2026R3Jul 2026R2Apr 2026
C++23 introduced `mdspan` ([[P0009R18]](https://wg21.link/p0009r18)), a non-owning multidimensional array abstraction that has a customizable layout. Layout customization was originally motivated in [[P0009R18]](https://wg21.link/p0009r18) with considerations for interoperability and performance, particularly on different architectures. Moreover, [[P2630R4]](https://wg21.link/p2630r4) introduced `submdspan`, a slicing function that can yield arbitrarily strided layouts. However, without standard library support, copying efficiently between `mdspan`s with mixes of complex layouts is challenging for users.