MCPcopy Create free account
hub / github.com/pybind/pybind11 / TEST_SUBMODULE

Function TEST_SUBMODULE

tests/test_class_sh_unique_ptr_member.cpp:37–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35};
36
37TEST_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

Callers

nothing calls this directly

Calls 1

argClass · 0.50

Tested by

no test coverage detected