-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Folding algorithms #3099
Merged
Merged
Folding algorithms #3099
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
35bde4c
Add `in_value_result`
JMazurkiewicz b58023e
Add concepts from the paper
JMazurkiewicz 4582ca2
Add feature test macro
JMazurkiewicz 077d532
Initial implementation of `ranges::fold*`
JMazurkiewicz c11d6a2
Add missing test coverage for `ranges::in_value_result`
JMazurkiewicz 3fa441b
Change return type of `_Fold_left_with_iter_unchecked`
JMazurkiewicz 21a44eb
Test coverage cleanup
JMazurkiewicz fdca2fe
Check `ranges::dangling` in call to `ranges::fold_left[_first]_with_i…
JMazurkiewicz ef7dbc6
Test more folds with empty ranges
JMazurkiewicz d8fe8db
Rename variables in tests: `resN` -> `sumN`
JMazurkiewicz 8c56ffc
Rename variables in tests: `(left/right)_folded_sum` -> `(left/right)…
JMazurkiewicz 728f92d
Test multiplication in `fold_right(_first)` tests
JMazurkiewicz 20ee9df
Test subtraction in `fold_left_first(_with_iter)` tests
JMazurkiewicz 2fd84c4
A little bit better test of `ranges::in_value_result`
JMazurkiewicz f168505
Add test coverage to `test.lst`
JMazurkiewicz 7ee8a1b
Move test comment in `yvals_core.h`
JMazurkiewicz 9e27501
Add `empty_rng` variable in tests
JMazurkiewicz df4a3cb
Tests: `vector<double>` -> `const vector<double>` (+ last tweaks befo…
JMazurkiewicz 1684bdf
Make `_Fold_right_last_unchecked` invoke `_Fold_right_unchecked` dire…
JMazurkiewicz 932f78a
`__cpp_lib_fold` -> `__cpp_lib_ranges_fold`
JMazurkiewicz 623df07
Use `static_cast` and `_Ubegin`
JMazurkiewicz 727ca6d
Create temporary `_Init_ref` variable
JMazurkiewicz 7ea2809
Include `<optional>` only in C++23 mode
JMazurkiewicz fc7741f
Fix comment in `yvals_core.h`
JMazurkiewicz 216fede
Make `fold_left` and `fold_left_with_iter(R)` call `fold_left_with_it…
JMazurkiewicz 9abf727
Make `fold_left_first` and `fold_left_first_with_iter(R)` call `fold_…
JMazurkiewicz bd996f3
Make `_Fold_left_(first_)with_iter` functions private members
JMazurkiewicz 2a767da
Example of what I mean
strega-nil b660eec
really should have run build/tests
strega-nil f161da3
Merge remote-tracking branch 'upstream/main' into JMazurkiewicz/fold
strega-nil e60d090
Merge branch 'main' into fold
JMazurkiewicz d5ef5a6
_EXPORT_STD!
JMazurkiewicz 14b6c75
Rename `in_value_result`'s template arguments (for consistency)
JMazurkiewicz bb1c947
Merge branch 'main' into fold
JMazurkiewicz ca43eac
Update formatting
JMazurkiewicz e0e9de8
Update formatting (again)
JMazurkiewicz 5dab66e
Remove `clang-format [off/on]` comments
JMazurkiewicz 5fcedeb
Include <utility> for move().
StephanTLavavej 10a9b3b
Fix typos: fold_left => fold_right.
StephanTLavavej d7b7bd2
Add _RANGES qualification.
StephanTLavavej ca4cc6f
Use static_cast<iter_value_t<_It>> to avoid functional-style casts.
StephanTLavavej d505bcd
Use braces to construct optional.
StephanTLavavej 5c57818
Merge branch 'main' into fold
StephanTLavavej 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
RUNALL_INCLUDE ..\concepts_latest_matrix.lst |
Oops, something went wrong.
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.
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.
Ideally we'd want this to avoid the extra move into the
in_value_result
and back out. (This is why the wording uses Returns: instead of "Effects: Equivalent toreturn ...;
")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.
Do RVO or deferred temporary materialization help with that?
I think this would be reasonable to address in a followup PR.