| 353 | return true; // unused, but gives the same signature as the deregister func |
| 354 | } |
| 355 | inline 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 | |
| 369 | inline void register_instance(instance *self, void *valptr, const type_info *tinfo) { |
| 370 | register_instance_impl(valptr, self); |
no test coverage detected