| 35 | }; |
| 36 | |
| 37 | TEST_SUBMODULE(class_sh_unique_ptr_member, m) { |
| 38 | py::classh<pointee>(m, "pointee").def(py::init<>()).def("get_int", &pointee::get_int); |
| 39 | |
| 40 | m.def("make_unique_pointee", make_unique_pointee); |
| 41 | |
| 42 | py::class_<ptr_owner>(m, "ptr_owner") |
| 43 | .def(py::init<std::unique_ptr<pointee>>(), py::arg("ptr")) |
| 44 | .def("is_owner", &ptr_owner::is_owner) |
| 45 | .def("give_up_ownership_via_unique_ptr", &ptr_owner::give_up_ownership_via_unique_ptr) |
| 46 | .def("give_up_ownership_via_shared_ptr", &ptr_owner::give_up_ownership_via_shared_ptr); |
| 47 | } |
| 48 | |
| 49 | } // namespace class_sh_unique_ptr_member |
| 50 | } // namespace pybind11_tests |