Skip to content
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

Can't use auto when defining lambda function callbacks for methods like Node::Advertise #203

Open
adlarkin opened this issue Nov 19, 2020 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@adlarkin
Copy link
Contributor

As the title states, when trying to call a method like Advertise with a lambda function callback to create a service, the lambda function must be created before the Advertise method, and must also be fully defined - if the lambda function is created using type auto, then compilation fails when passing this lambda function into the Advertise method. An example can be found here.

@chapulina chapulina added enhancement New feature or request help wanted Extra attention is needed labels Nov 19, 2020
@adlarkin
Copy link
Contributor Author

adlarkin commented Apr 20, 2021

I believe that this is the reason why we must fully define the lambda function before calling Advertise: https://stackoverflow.com/a/13359347

Taking a look at EntityComponentManager::Each in ign-gazebo, I notice that an identity is used there, which might be why you don't need to pre-define a lambda function when calling EntityComponentManager::Each (I don't see an identity being used for Node::Advertise).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants