-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Use rvalue reference for std::variant cast_op<T> #3811
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
Nearly every call site of cast_op<T> uses an r-value reference. Except stl.h variant_caster::load_alternative for handling std::variant. Fix that.
NOTE: I have not yet run extensive tests on this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI is happy, what could possibly go wrong! :-)
I'll try to run our global testing tonight with this included.
It should be safe, the |
Also, it's possible that this overload of
Because it will change the default Changing it will break code. I think that the only current use of that overload is in the std::reference_wrapper type_caster. But who knows about other users. Not a high priority. |
Google global testing with this PR passed (2022-03-18 05:00 batch, test token OCL:435561515:BASE:435643811:1647617193745:53ea324). |
I'll go ahead merging this 1-line change, based on the extensive testing, to get it into the smart_holder update I'm working on right now. |
Nearly every call site of cast_op<T> uses an r-value reference. Except stl.h variant_caster::load_alternative for handling std::variant. Fix that.
Nearly every call site of
cast_op<T>
uses an r-value reference.Except in stl.h
variant_caster::load_alternative
which handlesstd::variant
.Fix that.