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

Class B

tests/test_modules.cpp:38–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36 py::class_<A>(m_sub, "A").def(py::init<int>()).def("__repr__", &A::toString);
37
38 class B {
39 public:
40 B() { print_default_created(this); }
41 ~B() { print_destroyed(this); }
42 B(const B &) { print_copy_created(this); }
43 B &operator=(const B &copy) {
44 print_copy_assigned(this);
45 a1 = copy.a1;
46 a2 = copy.a2;
47 return *this;
48 }
49 A &get_a1() { return a1; }
50 A &get_a2() { return a2; }
51
52 A a1{1};
53 A a2{2};
54 };
55 py::class_<B>(m_sub, "B")
56 .def(py::init<>())
57 .def("get_a1",

Callers

nothing calls this directly

Calls 1

print_copy_assignedFunction · 0.85

Tested by

no test coverage detected