-
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
fix: enable bind_map
with using
declarations.
#4952
Conversation
Could you please add a test that does not work without this PR? — That's the only way to ensure that there are no regressions long-term. See tests/test_stl_binders.cpp and maybe tests/test_stl_binders.py |
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.
LGTM but could you please also add minimal tests in test_stl_bind.py? Just enough to be sure the new py::bind_vector
and py::bind_map
are not accidentally lost in the future.
IMHO this is not necessary. This was purely a compilation fix. |
That's what I understood. But there is a chance that the two new lines are accidentally removed when refactoring. Adding minimal tests (maybe 2 x 2 lines) is very easy and makes it much less likely that something gets lost accidentally. |
I have added a Python test. Thanks for taking the time. |
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.
Thanks, looks great!
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.
This seems to be the only obvious fix. Lambdas can be more expensive to compile, but I think that's with capture, which isn't used for these. So I think it's fine.
bind_map
with using
declarations.bind_map
with using
declarations.
bind_map
with using
declarations.bind_map
with using
declarations.
Description
Enable using
py::bind_map
with map-like things that privately inherit from map +using
declarations.Suggested changelog entry: