]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Make layout_left(layout_stride) noexcept.
authorLuc Grosheintz <luc.grosheintz@gmail.com>
Wed, 4 Jun 2025 14:58:53 +0000 (16:58 +0200)
committerTomasz Kamiński <tkaminsk@redhat.com>
Thu, 12 Jun 2025 09:56:02 +0000 (11:56 +0200)
commit1620e1ac8f5654678245f9f0eda876d0dec0b567
tree44f4e1cb3e07f09f5a45759425e1e63f5a2cceec
parent4e3dbecb90dec76714474df867bfcc2073ad6a9b
libstdc++: Make layout_left(layout_stride) noexcept.

[mdspan.layout.left.cons] of N4950 states that this ctor is not
noexcept. Since, all other ctors of layout_left, layout_right or
layout_stride are noexcept, the choice was made, based on
[res.on.exception.handling], to make this ctor noexcept.

Two other major standard library implementations make the same choice.

libstdc++-v3/ChangeLog:

* include/std/mdspan (layout_left): Strengthen the exception
guarantees of layout_left::mapping(layout_stride::mapping).
* testsuite/23_containers/mdspan/layouts/ctors.cc:
Simplify tests to reflect the change.

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