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

Class A

tests/test_modules.cpp:21–35  ·  view source on GitHub ↗

test_reference_internal

Source from the content-addressed store, hash-verified

19
20 // test_reference_internal
21 class A {
22 public:
23 explicit A(int v) : v(v) { print_created(this, v); }
24 ~A() { print_destroyed(this); }
25 A(const A &) { print_copy_created(this); }
26 A &operator=(const A &copy) {
27 print_copy_assigned(this);
28 v = copy.v;
29 return *this;
30 }
31 std::string toString() const { return "A[" + std::to_string(v) + "]"; }
32
33 private:
34 int v;
35 };
36 py::class_<A>(m_sub, "A").def(py::init<int>()).def("__repr__", &A::toString);
37
38 class B {

Callers

nothing calls this directly

Calls 1

print_copy_assignedFunction · 0.85

Tested by

no test coverage detected