-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: - It is relatively common to want to do for_each on a bitset, but also capture whether or not the action succeeded at all, e.g. when handling a message with an indexed handler. Solution: - Add `transform_reduce` on bitset. Note: - Both `for_each` and `transform_reduce` are applicable variadically, however this is not yet implemented. But this is the reason that the bitset is the final argument. - There are some differences (for the better) from the `std::transform_reduce` API. - The transform function comes before the reduction function. `std::transform_reduce` is confusing, because the transform happens first but is given second. - The type of the `init` value can be easily given in a template argument; this is helpful for avoiding warnings when passing `0` (an `int`) to accumulate potentially larger integral types.
- Loading branch information
Showing
3 changed files
with
54 additions
and
0 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