-
Notifications
You must be signed in to change notification settings - Fork 71
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
Two helper ranges to simplify the rewriting of co-routines to C++17 #1892
Conversation
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
and this seems to work. Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1892 +/- ##
==========================================
+ Coverage 90.58% 90.61% +0.02%
==========================================
Files 413 414 +1
Lines 40041 40100 +59
Branches 4528 4536 +8
==========================================
+ Hits 36272 36335 +63
+ Misses 2420 2416 -4
Partials 1349 1349 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1-1 with Johannes, impressive stuff (easy to use by example, but not so easy to understand in depth and to design in the first place)
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Round 2 with Johannes, looks great
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now, when the tests runs through, I will make another quick pass, write a description and merge it
# Conflicts: # test/CMakeLists.txt
Conformance check passed ✅No test result changes. |
|
This introduces
CachingTransformInputRange
andCachingContinuableTransformInputRange
, two abstractions that will make the porting from C++20 generators to C++17 easier.CachingTransformInputRange
is similar toranges::transform
, but caches the intermediate results by value and always is anInputRange
. This is closer to the behavior of coroutines thanranges::transform
which in particular recomputes the transformation if the same iterator is dereferenced multiple times.CachingContinuableTransformInputRange
in addition has special return values for the transformation which can control the iteration, e.g.Continue
(skip the current element).