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

Function bind_ConstructorStats

tests/pybind11_tests.cpp:44–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44void bind_ConstructorStats(py::module_ &m) {
45 py::class_<ConstructorStats>(m, "ConstructorStats")
46 .def("alive", &ConstructorStats::alive)
47 .def("values", &ConstructorStats::values)
48 .def_readwrite("default_constructions", &ConstructorStats::default_constructions)
49 .def_readwrite("copy_assignments", &ConstructorStats::copy_assignments)
50 .def_readwrite("move_assignments", &ConstructorStats::move_assignments)
51 .def_readwrite("copy_constructions", &ConstructorStats::copy_constructions)
52 .def_readwrite("move_constructions", &ConstructorStats::move_constructions)
53 .def_static("get",
54 (ConstructorStats & (*) (py::object)) & ConstructorStats::get,
55 py::return_value_policy::reference_internal)
56
57 // Not exactly ConstructorStats, but related: expose the internal pybind number of
58 // registered instances to allow instance cleanup checks (invokes a GC first)
59 .def_static("detail_reg_inst", []() {
60 ConstructorStats::gc();
61 return py::detail::num_registered_instances();
62 });
63}
64
65const char *cpp_std() {
66 return

Callers 1

PYBIND11_MODULEFunction · 0.85

Calls 1

num_registered_instancesFunction · 0.85

Tested by

no test coverage detected