-
Notifications
You must be signed in to change notification settings - Fork 17k
[libc++] P2770R0: "Stashing stashing iterators for proper flattening" #66033
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
600a282
[libc++] P2770R0: "Stashing stashing iterators for proper flattening"
JMazurkiewicz 743b01d
Merge branch 'main' into libcxx/ranges/stashing2
JMazurkiewicz f601c07
Enable `__as_lvalue` in >C++03 modes
JMazurkiewicz be16b57
Split `as-lvalue.verify.cpp`
JMazurkiewicz 181cd85
Add missing `explicit` specifier in `__iterator(_Parent& __parent)`
JMazurkiewicz d11d81c
Restore old `__sentinel<C>` friendship in `join_view::_sentinel`
JMazurkiewicz 03454c2
Un-experimental more `join_view` related tests
JMazurkiewicz 7de9a77
Make `join_view::__iterator::__outer_` private
JMazurkiewicz f256e1f
Add test with code from LWG-3698
JMazurkiewicz 1f00358
Whitespace amendments
JMazurkiewicz d5d0610
Add extra static assertion for `[range.join.iterator] Note 1`
JMazurkiewicz 3861ffa
Fix comment: `!forward_range<iterator_t<Base>>` -> `!forward_range<Ba…
JMazurkiewicz 0e92781
Make `as-lvalue.pass.cpp` C++11 friendly
JMazurkiewicz 54c31fc
Add `return 0;` in LWG-3698 test
JMazurkiewicz 62fa3a7
Revert "Make `as-lvalue.pass.cpp` C++11 friendly"
JMazurkiewicz aebbbac
Make `as-lvalue.pass.cpp` C++14 friendly
JMazurkiewicz ca61a70
Test `iterator(Parent& parent, OuterIter outer)` constructor
JMazurkiewicz 024b9e2
Test `iterator(Parent& parent)` constructor
JMazurkiewicz 857aae1
Merge branch 'main' into libcxx/ranges/stashing
JMazurkiewicz 710398a
Address GCC's complaints
JMazurkiewicz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add test with code from LWG-3698
Comment: #66033 (comment)
- Loading branch information
commit f256e1f9e663ec64ade659520b1b9494d8f0fe9d
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
libcxx/test/std/ranges/range.adaptors/range.join/lwg3698.pass.cpp
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| // UNSUPPORTED: c++03, c++11, c++14, c++17 | ||
| // UNSUPPORTED: no-localization | ||
|
|
||
| // Check LWG-3698: `regex_iterator` and `join_view` don't work together very well | ||
|
|
||
| #include <algorithm> | ||
| #include <array> | ||
| #include <cassert> | ||
| #include <ranges> | ||
| #include <regex> | ||
| #include <string_view> | ||
|
|
||
| int main(int, char**) { | ||
| char const text[] = "Hello"; | ||
| std::regex regex{"[a-z]"}; | ||
|
|
||
| auto lower = | ||
| std::ranges::subrange( | ||
| std::cregex_iterator(std::ranges::begin(text), std::ranges::end(text), regex), std::cregex_iterator{}) | | ||
| std::views::join | std::views::transform([](auto const& sm) { return std::string_view(sm.first, sm.second); }); | ||
|
|
||
| assert(std::ranges::equal(lower, std::to_array<std::string_view>({"e", "l", "l", "o"}))); | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.