Hello gcc-team, the following code: ```cpp #include <concepts> #include <ranges> #include <span> #include <string_view> static_assert(std::same_as<std::span<int>, decltype(std::views::take(std::span<int>{}, 2))>); static_assert(std::same_as<std::string_view, decltype(std::views::take(std::string_view{}, 2))>); ``` does not compile (yet). https://godbolt.org/z/6Mq7x8zaj AFAIK this should be http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1739r0.md that was merged by https://github.com/cplusplus/draft/pull/3777. There was a rather amusing error report at stackoverflow [1]. I tried to find that proposal in [2] but couldn't and wanted to ask if I looked at the wrong place. If you have time to implement this, that would be awesome! Thank you! [1] https://stackoverflow.com/questions/61867635/recursive-application-of-c20-range-adaptor-causes-a-compile-time-infinite-loop [2] https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2020
Some of the wording changes of P1739 are problematic as discussed in LWG issue 3407 (https://cplusplus.github.io/LWG/lwg-active.html#3407), which is why we don't implement it yet. Though I suppose we could at least implement the workable parts of P1739 while waiting for the LWG issue to get resolved.
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:926d4a71c7e5a2f7d17a4f943d6e7fe9f1e3ba55 commit r12-3021-g926d4a71c7e5a2f7d17a4f943d6e7fe9f1e3ba55 Author: Jonathan Wakely <jwakely@redhat.com> Date: Thu Aug 19 11:44:57 2021 +0100 libstdc++: Document P1739R4 status [PR100139] We should document the status of this unimplemented feature. Signed-off-by: Jonathan Wakely <jwakely@redhat.com> libstdc++-v3/ChangeLog: PR libstdc++/100139 * doc/xml/manual/status_cxx2020.xml: Add P1739R4 to status table. * doc/html/manual/status.html: Regenerate.
The releases/gcc-11 branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:31433e154f5eecb17151d77b259b13d41c0b8e7c commit r11-8886-g31433e154f5eecb17151d77b259b13d41c0b8e7c Author: Jonathan Wakely <jwakely@redhat.com> Date: Thu Aug 19 11:44:57 2021 +0100 libstdc++: Document P1739R4 status [PR100139] We should document the status of this unimplemented feature. Signed-off-by: Jonathan Wakely <jwakely@redhat.com> libstdc++-v3/ChangeLog: PR libstdc++/100139 * doc/xml/manual/status_cxx2020.xml: Add P1739R4 to status table. * doc/html/manual/status.html: Regenerate. (cherry picked from commit 926d4a71c7e5a2f7d17a4f943d6e7fe9f1e3ba55)
The releases/gcc-10 branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:321ff3ad38e05096abc4de6d3bb2150cc0f75d91 commit r10-10047-g321ff3ad38e05096abc4de6d3bb2150cc0f75d91 Author: Jonathan Wakely <jwakely@redhat.com> Date: Thu Aug 19 11:44:57 2021 +0100 libstdc++: Document P1739R4 status [PR100139] We should document the status of this unimplemented feature. Signed-off-by: Jonathan Wakely <jwakely@redhat.com> libstdc++-v3/ChangeLog: PR libstdc++/100139 * doc/xml/manual/status_cxx2020.xml: Add P1739R4 to status table. * doc/html/manual/status.html: Regenerate. (cherry picked from commit 926d4a71c7e5a2f7d17a4f943d6e7fe9f1e3ba55)