-
Notifications
You must be signed in to change notification settings - Fork 7
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
[FEATURE] support kumi::map without a return type #3
Comments
|
In this case I have a zip-like thing happening and really do want map-like functionality. std::vector<int> a, b, c, d;
kumi::tuple l = { std::ref(a), std::ref(b) };
kumi::tuple r = {std::ref(c), std::ref(d) };
kumi::map([](auto&& l, auto&& r) {
return l[0] = r[0]; // don't want to return
}, l, r); |
It's possible that this should just be a separate function named |
I fail to see how
is not:
Is that you want it to be called map? I mean, it's not rly map. |
If I’m unfamiliar with the use of algorithms called |
Is your feature request related to a problem? Please describe.
When I have tuples of references it makes sense to
map
them without returning anything. Currently providing an invocable that returnsvoid
results in a compilation error.Describe the solution you'd like
Specialize on the return type of the function object, if
void
then don't try and produce a tuple.Describe alternatives you've considered
The current workaround is to return something trivial, like
0
.Additional context
https://godbolt.org/z/b56T3ebjd
The text was updated successfully, but these errors were encountered: