forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libc++][ranges] LWG3984: ranges::to's recursion branch may be ill-fo…
…rmed (llvm#87964) This pull request implements LWG3984: ranges::to's recursion branch may be ill-formed. In the current implementation, ranges::to's recursion branch pipes the range into a `views::transform(/* lambda */)`, which is a __range_adaptor_closure object. In libc++, the pipe operator of __range_adaptor_closure requires a viewable_range, so the following code won't compile, as the type of lvalue `r` doesn't model viewable_range: #include <ranges> #include <vector> #include <list> int main() { std::vector<std::vector<int>> v; auto r = std::views::all(std::move(v)); auto l = std::ranges::to<std::list<std::list<int>>>(r); } Co-authored-by: A. Jiang <[email protected]>
- Loading branch information
1 parent
1728a56
commit e74be35
Showing
3 changed files
with
8 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters