]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Add missing constraints to views::indices
authorJonathan Wakely <jwakely@redhat.com>
Tue, 21 Oct 2025 20:21:45 +0000 (21:21 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 22 Oct 2025 08:59:36 +0000 (09:59 +0100)
commit437ed2fec78cbd72cd31922b7d506847e45c52f9
treeaa508f60a4ca06a348c47b19990f5f967e28d2f3
parent788fa7c613177b35e6c1e5098b8931480b4f0853
libstdc++: Add missing constraints to views::indices

Calling views::indices(n) should be expression equivalent to
views::iota(decltype(n)(0), n), which means it should have the same
constraints as views::iota and be SFINAE-friendly.

libstdc++-v3/ChangeLog:

* include/std/ranges (indices::operator()): Constrain using
__can_iota_view concept.
* testsuite/std/ranges/indices/1.cc: Check SFINAE-friendliness
required by expression equivalence. Replace unused <vector>
header with <stddef.h> needed for size_t.
libstdc++-v3/include/std/ranges
libstdc++-v3/testsuite/std/ranges/indices/1.cc