libstdc++: Define std::ranges::to for C++23 (P1206R7) [PR111055]
commit7a6a29c455e7755b501c0006e39beb4e56ec2729
authorJonathan Wakely <jwakely@redhat.com>
Tue, 19 Sep 2023 12:23:13 +0000 (19 13:23 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 23 Nov 2023 17:48:41 +0000 (23 17:48 +0000)
tree4ff795bbc89cfb12f0c5b2de2fec7030289aaa36
parent0585daf7de0673ade9feca1be66a68178786b48d
libstdc++: Define std::ranges::to for C++23 (P1206R7) [PR111055]

This adds the std::ranges::to functions for C++23. The rest of P1206R7
is not yet implemented, i.e. the new constructors taking the
std::from_range tag, and the new insert_range, assign_range, etc. member
functions. std::ranges::to works with the standard containers even
without the new constructors, so this is useful immediately.

The __cpp_lib_ranges_to_container feature test macro can be defined now,
because that only indicates support for the changes in <ranges>, which
are implemented by this patch. The __cpp_lib_containers_ranges macro
will be defined once all containers support the new member functions.

libstdc++-v3/ChangeLog:

PR libstdc++/111055
* include/bits/ranges_base.h (from_range_t): Define new tag
type.
(from_range): Define new tag object.
* include/bits/version.def (ranges_to_container): Define.
* include/bits/version.h: Regenerate.
* include/std/ranges (ranges::to): Define.
* testsuite/std/ranges/conv/1.cc: New test.
* testsuite/std/ranges/conv/2_neg.cc: New test.
* testsuite/std/ranges/conv/version.cc: New test.
libstdc++-v3/include/bits/ranges_base.h
libstdc++-v3/include/bits/version.def
libstdc++-v3/include/bits/version.h
libstdc++-v3/include/std/ranges
libstdc++-v3/testsuite/std/ranges/conv/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/std/ranges/conv/2_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/std/ranges/conv/version.cc [new file with mode: 0644]