https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110352
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Tomasz Kaminski <[email protected]>: https://gcc.gnu.org/g:f6f9aec0c6aac9d274fec9bbcc3e8e0030418016 commit r16-5837-gf6f9aec0c6aac9d274fec9bbcc3e8e0030418016 Author: Luc Grosheintz <[email protected]> Date: Mon Dec 1 09:41:37 2025 +0100 libstdc++: Implement submdspan_canonicalize_slices. [PR110352] Implements submdspan_canonicalize_slices as described in P3663 and adds it to the std module. There's one deviation from the standard. Doesn't (under all circumstances) require: 0 <= begin[k] <= end[k] <= exts.extent(k) where the k-th slice range is [begin[k], end[k]). Instead, it requires that the k-th slice ranges is contained in the k-th extent interval. If the slice range is empty, then that condition is always satisfied, even if begin[k] == end[k] > exts.extent(k) The deviation is that we enforce the above inequality through preconditions. This is analogous to what the standard requires if begin[k] is a constant wrapper. PR libstdc++/110352 libstdc++-v3/ChangeLog: * include/std/mdspan (submdspan_canonicalize_slices): New function. * src/c++23/std.cc.in (submdspan_canonicalize_slices): Add. * testsuite/23_containers/mdspan/submdspan/submdspan_canonicalize_slices.cc: New test. * testsuite/23_containers/mdspan/submdspan/submdspan_canonicalize_slices_neg.cc: New test. Reviewed-by: Tomasz KamiÅski <[email protected]> Signed-off-by: Luc Grosheintz <[email protected]>
