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

Function deregister_instance_impl

include/pybind11/detail/class.h:355–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353 return true; // unused, but gives the same signature as the deregister func
354}
355inline bool deregister_instance_impl(void *ptr, instance *self) {
356 assert(ptr);
357 return with_instance_map(ptr, [&](instance_map &instances) {
358 auto range = instances.equal_range(ptr);
359 for (auto it = range.first; it != range.second; ++it) {
360 if (self == it->second) {
361 instances.erase(it);
362 return true;
363 }
364 }
365 return false;
366 });
367}
368
369inline void register_instance(instance *self, void *valptr, const type_info *tinfo) {
370 register_instance_impl(valptr, self);

Callers 1

deregister_instanceFunction · 0.85

Calls 1

with_instance_mapFunction · 0.85

Tested by

no test coverage detected