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

Method use_count

tests/test_local_bindings.cpp:29–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 std::shared_ptr<int> contents;
28 int value() const { return contents ? *contents : -20251012; }
29 long use_count() const { return contents.use_count(); }
30 };
31 py::class_<SharedKeepAlive>(m, "SharedKeepAlive")
32 .def_property_readonly("value", &SharedKeepAlive::value)

Calls

no outgoing calls

Tested by

no test coverage detected