]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Relax range adaptors for move-only types (P2494R2)
authorJonathan Wakely <jwakely@redhat.com>
Tue, 5 Sep 2023 21:07:22 +0000 (22:07 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 7 Sep 2023 07:05:15 +0000 (08:05 +0100)
commit9f41791eff82d5f41f16204cf092b7888b6c7a8d
treef51690ad1526aa4c1478a04a21305c546f7cf087
parent833733702a7037b175f15daee85df1d64140ec05
libstdc++: Relax range adaptors for move-only types (P2494R2)

This is a C++23 feature that relaxes the constraints on some range
adaptors, to support move-only types.

libstdc++-v3/ChangeLog:

* include/bits/version.def (ranges): Update value.
* include/bits/version.h: Regenerate.
* include/std/ranges (__detail::__boxable): Use
move_constructible instead of copy_constructible for C++23.
(__detail::__box<T>): Adjust constraints for partial
specialization.
(single_view, transform_view): Use __box_constructible instead
of copy_constructible in constraints.
(zip_transform_view, adjacent_transform_view, repeat_view): Use
move_constructible instead of copy_constructible in constraints.
* testsuite/std/ranges/adaptors/adjacent_transform/1.cc: Check
construction from move-only argument.
* testsuite/std/ranges/adaptors/transform.cc: Likewise.
* testsuite/std/ranges/repeat/1.cc: Likewise.
* testsuite/std/ranges/single_view.cc: Likewise.
* testsuite/std/ranges/zip_transform/1.cc: Likewise.
* testsuite/std/ranges/version_c++23.cc: Adjust expected value
of __cpp_lib_ranges.
libstdc++-v3/include/bits/version.def
libstdc++-v3/include/bits/version.h
libstdc++-v3/include/std/ranges
libstdc++-v3/testsuite/std/ranges/adaptors/adjacent_transform/1.cc
libstdc++-v3/testsuite/std/ranges/adaptors/transform.cc
libstdc++-v3/testsuite/std/ranges/repeat/1.cc
libstdc++-v3/testsuite/std/ranges/single_view.cc
libstdc++-v3/testsuite/std/ranges/version_c++23.cc
libstdc++-v3/testsuite/std/ranges/zip_transform/1.cc