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

Method Add

tests/test_class_sh_trampoline_shared_from_this.cpp:46–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44 explicit SftSharedPtrStash(int ser_no) : ser_no{ser_no} {}
45 void Clear() { stash.clear(); }
46 void Add(const std::shared_ptr<Sft> &obj) {
47 if (!obj->history.empty()) {
48 obj->history += "_Stash" + std::to_string(ser_no) + "Add";
49 }
50 stash.push_back(obj);
51 }
52 void AddSharedFromThis(Sft *obj) {
53 auto sft = obj->shared_from_this();
54 if (!sft->history.empty()) {

Calls 2

emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected