Skip to content
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

FWD pybind11 #4586

Closed
rwgk opened this issue Feb 11, 2023 · 0 comments
Closed

FWD pybind11 #4586

rwgk opened this issue Feb 11, 2023 · 0 comments

Comments

@rwgk
Copy link
Contributor

rwgk commented Feb 11, 2023

pybind/pybind11#4586

@rwgk rwgk closed this as completed Feb 11, 2023
rwgk pushed a commit to rwgk/pybind11clif that referenced this issue Mar 24, 2023
* Add test_class_sh_property_non_owning.cpp,py

Failing:

```
__________________________________________________________ test_persistent_holder __________________________________________________________

    def test_persistent_holder():
        h = m.DataFieldsHolder(2)
>       c = h.vec_at(0).core_fld
E       RuntimeError: Non-owning holder (loaded_as_shared_ptr).

h          = <pybind11_tests.class_sh_property_non_owning.DataFieldsHolder object at 0x7fabab516470>

test_class_sh_property_non_owning.py:6: RuntimeError
__________________________________________________________ test_temporary_holder ___________________________________________________________

    def test_temporary_holder():
        d = m.DataFieldsHolder(2).vec_at(1)
>       c = d.core_fld
E       RuntimeError: Non-owning holder (loaded_as_shared_ptr).

d          = <pybind11_tests.class_sh_property_non_owning.DataField object at 0x7fabab548770>

test_class_sh_property_non_owning.py:13: RuntimeError
```

* Introduce `shared_ptr_from_python(responsible_parent)` and use in all `property_cpp_function`s with `const shared_ptr<T> &` arguments.

Tests are incomplete.

* Complete tests.

* Add comment for `smart_holder_type_caster_load<T>::shared_ptr_from_python`
rwgk pushed a commit to rwgk/pybind11clif that referenced this issue Mar 24, 2023
* use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (google#4587)

* Apply descr.h `src_loc` change (smart_holder PR google#4022) to code added with master PR google#4587

* Add test_class_sh_property_non_owning to CMakeLists.txt (fixes oversight in PR google#4586)

* Resolve clang-tidy errors.

* clang-tidy auto fix

---------

Co-authored-by: Konstantin Bespalov <kos5tya@yandex.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant