-
Notifications
You must be signed in to change notification settings - Fork 398
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
iox::function claims to support moving functions, but doesn't #2319
Comments
@gpalmer-latai how big of an issue is this right now? We are currently quite busy with the iceoryx2 C and C++ bindings and I would look into this once we are done with them. |
It's not a super huge priority. There are workarounds like using a I mostly wanted to make sure to document the issue in the off chance someone did have a few free cycles or came across the same issue. |
I marked it as good first issue ... let's hope it's not a bottomless pit once someone has a closer look at it |
Haha yeah. I mean, on the one hand maybe overloading that function with a signature allowing rvalue references is enough (at least - it appears std::function does this: https://en.cppreference.com/w/cpp/utility/functional/function/function). On the other hand, I've seen several C++ weekly videos by Jason Turner where he basically explains implementing std::function correctly is notoriously hard and a great exercise to learn about a lot of advanced C++ features. |
So a great good first issue :) |
Required information
In the docstring for the
iox::function
interface, it is claimed thatHowever in the actual implementation docstring this is contradicted:
And indeed if you attempt to wrap a lambda with a move capture, such as
You'll get a compile error:
Operating system:
E.g. Ubuntu 20.04 LTS
Compiler version:
E.g. GCC 9.4.0
Eclipse iceoryx version:
On an older checkout of main, but should apply to main as well.
Observed result or behaviour:
iox::function
does not support move-only functorsExpected result or behaviour:
It should support move-only functors, as documented in the API.
Conditions where it occurred / Performed steps:
Try to wrap a lambda with a move-capture.
Additional helpful information
The text was updated successfully, but these errors were encountered: