]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Improve and cleanup mdspan related code.
authorLuc Grosheintz <luc.grosheintz@gmail.com>
Tue, 30 Sep 2025 10:55:18 +0000 (12:55 +0200)
committerTomasz Kamiński <tkaminsk@redhat.com>
Wed, 8 Oct 2025 10:30:51 +0000 (12:30 +0200)
commit5733ecea0795b3b4f152dc33bb3aacd4ecfcf05f
treef8d9b0d9e53ca081fb37f11697ddd3d17d868423
parent6b999bf40090f356c5bb5ff8a82e7e0dc4c4ae05
libstdc++: Improve and cleanup mdspan related code.

The improvement is that in __index_type_cast, we don't need to check at
runtime if we know that _IndexType is smaller than _OIndexType.

The cleanup is whitespace (overlength lines) in <mdspan>, grouping is_always_foo
and is_foo together, and de-uglifying a variable in test code.

libstdc++-v3/ChangeLog:

* include/std/mdspan (__mdspan::__index_type_cast): Optimize by
skipping a __glibcxx_assert if it's know at compile-time.
(std::layout_left_padded, std::layout_righ_padded): Reorder
is_always_strided and is_unique member functions.
* testsuite/23_containers/mdspan/int_like.h: Rename _M_i to
value.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
libstdc++-v3/include/std/mdspan
libstdc++-v3/testsuite/23_containers/mdspan/int_like.h