diff options
author | Luc Grosheintz <luc.grosheintz@gmail.com> | 2025-07-08 11:49:21 +0200 |
---|---|---|
committer | Tomasz Kamiński <tkaminsk@redhat.com> | 2025-07-08 16:48:46 +0200 |
commit | 9c600a7e6cc588d2ee79d764cbf69ad677b1bac5 (patch) | |
tree | ef5012f51b4ef57a66ee2681dc23e15c1c0a5af2 /libstdc++-v3/testsuite/std | |
parent | bb6075e7115208bab3d9c8b2c54e0bd6a5c808b7 (diff) | |
download | gcc-9c600a7e6cc588d2ee79d764cbf69ad677b1bac5.zip gcc-9c600a7e6cc588d2ee79d764cbf69ad677b1bac5.tar.gz gcc-9c600a7e6cc588d2ee79d764cbf69ad677b1bac5.tar.bz2 |
libstdc++: Better CTAD for span and mdspan [PR120914].
This implements P3029R1. In P3029R1, the CTAD for span is refined to
permit deducing the extent of the span from an integral constant, e.g.
span((T*) ptr, integral_constant<size_t, 5>{});
is deduced as span<T, 5>. Similarly, in
auto exts = extents(integral_constant<int, 2>);
auto md = mdspan((T*) ptr, integral_constant<int, 2>);
exts and md have types extents<size_t, 2> and mdspan<double,
extents<size_t, 2>>, respectively.
PR libstdc++/120914
libstdc++-v3/ChangeLog:
* include/std/span (span): Update CTAD to enable
integral constants [P3029R1].
* include/std/mdspan (extents): ditto.
(mdspan): ditto.
* testsuite/23_containers/span/deduction.cc: Test deduction
guide.
* testsuite/23_containers/mdspan/extents/misc.cc: ditto.
* testsuite/23_containers/mdspan/mdspan.cc: ditto.
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
Diffstat (limited to 'libstdc++-v3/testsuite/std')
0 files changed, 0 insertions, 0 deletions