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

Function PYBIND11_MODULE

tests/test_cross_module_rtti/bindings.cpp:11–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9};
10
11PYBIND11_MODULE(test_cross_module_rtti_bindings, m) {
12 pybind11::classh<lib::Base, BaseTrampoline>(m, "Base")
13 .def(pybind11::init<int, int>())
14 .def_readwrite("a", &lib::Base::a)
15 .def_readwrite("b", &lib::Base::b);
16
17 m.def("get_foo", [](int a, int b) -> std::shared_ptr<lib::Base> {
18 return std::make_shared<lib::Foo>(a, b);
19 });
20}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected