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

cpp_wrapper Aeron should not move-from its l-value reference constructor parameter #1730

Open
lukeocamden opened this issue Jan 23, 2025 · 0 comments

Comments

@lukeocamden
Copy link

Hello, this tripped me up today. I wonder if it's not too late to fix.

Aeron's constructor has a parameter of type Context& and moves from it, which is pretty surprising. This code compiles and crashes:

aeron::Context context;
aeron::Aeron aeron(context);
context.cncFileName();

I think if the constructor is going to consume its parameter, I think the parameter should be of type Context or Context&& so that the above doesn't compile?

Let me know what you think!

@lukeocamden lukeocamden changed the title cpp_wrapper Aeron should not move-from its l-value constructor parameter cpp_wrapper Aeron should not move-from its l-value reference constructor parameter Jan 23, 2025
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

No branches or pull requests

1 participant