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

Rename ambiguous _iter_driver and pair_contained #134

Closed
wants to merge 1 commit into from

Conversation

traversaro
Copy link
Contributor

In the AttachView containers, the variables _iter_driver and pair_container was used to refer to both a reference argument passed to the container, and also to a pointer local variable that was defined inside a lamba function passed to a delating constructor.

In general this may not be readable, but on Windows with Visual Studio 2022 (cl.exe version: 19.29.30153) this also creates a compilation error:

D:\src\zenoh-cpp\include\zenohcxx\api.hxx(713,34): error C3493: '_iter_driver' cannot be implicitly captured because no default capture mode has been specified [D:\src\zenoh-cpp\examples\build2022\z_simple_zenohc.vcxproj]
D:\src\zenoh-cpp\include\zenohcxx\api.hxx(726,48): error C3493: 'pair_container' cannot be implicitly captured because no default capture mode has been spe
cified [D:\src\zenoh-cpp\examples\build2022\z_pub_attachment_zenohc.vcxproj]

This PR solves both the compilation problem (and the general readability problem) by renaming the local variables to a different name.

@traversaro
Copy link
Contributor Author

Not sure why the bot is not finding my eca. I guess there may be some cache that needs to be updated, I will wait a bit and try again.

@traversaro
Copy link
Contributor Author

Not sure why the bot is not finding my eca. I guess there may be some cache that needs to be updated, I will wait a bit and try again.

I opened a new identical PR in #136 and now it seems that it is working fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant