-
Notifications
You must be signed in to change notification settings - Fork 2.2k
smart_holder: open issues #2901
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
Comments
Hi Robert, are you using |
I'm using
|
It does :-) I tried to be really careful about. What you need is actually in the
Here are many examples: pybind11/tests/test_smart_ptr.cpp Line 277 in d6cf6df
Maybe I should rename the macro, because it's deceptively similar to |
Yes, that's on purpose: it could be used to undermine ownership correctness (you could call
Do you have a reproducer for this? |
Defining However, this is somewhat laborious and I didn't expect this would be needed.
See here. I can prepare a unit test in pybind11 if you like. It's essentially providing an iterator for I have some more test issues. Need to inspect them in more detail... |
Do you have actual custom holders? I'll look into the |
True, using the |
Sorry I need to explain this better before announcing the
That's unexpected. If you have |
|
You need I know this isn't great, but see the rationale from before (compatibility/fitting into exisiting more important than ease of use). Note that the PyCLIF pybind11 code generator we're working on does NOT use Moving everybody to smart_holder as the default will come with the advice to remove all |
Thanks for the feedback. I knew migrating away from |
Is this the error message for the
I need to debug that. If you could create a PR just for that case, with the "Allow edits and access to secrets by maintainers" box checked, that would be a great start for me. |
I'm closing this in favor of #2904. I tracked the issue down to a missing cast implementation. |
When using @rwgk's
smart_holder
branch and providing a custom holder type like this:py::class_<MyClass, std::shared_ptr<MyClass>, MyBaseClass>(m, "MyClass") .def(py::init<>());
I've got a misleading static assert:
I would assume:
The text was updated successfully, but these errors were encountered: