-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
chore: perfectly forward all make_iterator args #3980
chore: perfectly forward all make_iterator args #3980
Conversation
…ion007/make-iterator-pforwarding
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.
To explain my rationale, in contrast to PR #3970: here you are just inserting a few &&
and std::move()
, and use emplace_back()
instead of push_back()
. If we lose any of those, optimizations again, so be it.
In PR #3970, you are adding new functions and member functions. That's clearly a level up in terms of code complexity, and there is also more danger that overloads get lost unnoticed. I want to maintain a quality standard that includes: if an entire (member) function is removed accidentally, we need to see test breakages.
FYI, I think this change is causing ambiguous resolution:
I can fix it by adding a |
This reverts commit 8da58da.
* Revert "chore: perfectly forward all make_iterator args (pybind#3980)" This reverts commit 8da58da. * Redo unrelated optimization in commit * Add tests for ambiguous overloads
Description
This forwards all args in make_iterator. This should be more efficient and allow downstream functions to use the rvalue / lvalue nature of the args).
Suggested changelog entry: