]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Sync concat_view with final P2542 revision [PR115209]
authorPatrick Palka <ppalka@redhat.com>
Thu, 20 Feb 2025 03:59:49 +0000 (22:59 -0500)
committerPatrick Palka <ppalka@redhat.com>
Thu, 20 Feb 2025 03:59:49 +0000 (22:59 -0500)
commit8543dc52d84662e3fc0b8b6ac5e98ce13ebe9ad9
treee2ac86dd785d7aefd89f7ccad37a3e994e04907d
parent6d8e9cdbac40441b3dd33231285fda7fa4206d66
libstdc++: Sync concat_view with final P2542 revision [PR115209]

Our concat_view implementation is accidentally based off of an older
revision of the paper, P2542R7 instead of R8.  As far as I can tell the
only semantic change in the final revision is the relaxed constraints on
the iterator's iter/sent operator- overloads, which this patch updates.

This patch also simplifies the concat_view::end wording via C++26 pack
indexing as per the final revision.  In turn we make the availability of
this library feature conditional on __cpp_pack_indexing.  (Note pack
indexing is implemented in GCC 15 and Clang 19).

PR libstdc++/115209

libstdc++-v3/ChangeLog:

* include/bits/version.def (ranges_concat): Depend on
__cpp_pack_indexing.
* include/bits/version.h: Regenerate.
* include/std/ranges (__detail::__last_is_common): Remove.
(__detail::__all_but_first_sized): New.
(concat_view::end): Use C++26 pack indexing instead of
__last_is_common as per R8 of P2542.
(concat_view::iterator::operator-): Update constraints on
iter/sent overloads as per R8 of P2542.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/include/bits/version.def
libstdc++-v3/include/bits/version.h
libstdc++-v3/include/std/ranges