-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Allow perfect forwarding of method args #2048
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
Conversation
Looks like a simple enough change. I'm curious though what kinds of types will actually be affected by this? |
This is a smaller component of #2047, correct? |
Yes, #2047 building on top of this one. |
This PR just enables perfect forwarding. It's not related to particular types, but to the type specifiers (e.g. & or &&) in method arguments.
No, the PR just enables rvalue arguments in methods. If the custom type supports rvalue reference casting (only with #2048), it will be possible to forward them to such method arguments. |
Seems quite safe, let's merge it and see if anyone complains. |
Great to see some progress here. Thanks for merging. |
This fixes #1694. I wanted to contribute something after filing issues #2046 and #2047.
The fix just adds perfect forwarding for method args to support both, lvalue and rvalue arguments.
The unit test required a minor adaptation as
ExampleMandA::add1()
now copies and moves (instead of copying twice).