You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments