MCPcopy Create free account
hub / github.com/AllentDan/LibtorchTutorials / erase

Method erase

lesson6-Segmentation/json.hpp:16473–16490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16471 }
16472
16473 size_type erase(const Key& key)
16474 {
16475 for (auto it = this->begin(); it != this->end(); ++it)
16476 {
16477 if (it->first == key)
16478 {
16479 // Since we cannot move const Keys, re-construct them in place
16480 for (auto next = it; ++next != this->end(); ++it)
16481 {
16482 it->~value_type(); // Destroy but keep allocation
16483 new (&*it) value_type{std::move(*next)};
16484 }
16485 Container::pop_back();
16486 return 1;
16487 }
16488 }
16489 return 0;
16490 }
16491
16492 iterator erase(iterator pos)
16493 {

Callers 5

UNetDecoderImplMethod · 0.80
forwardMethod · 0.80
end_objectMethod · 0.80
eraseFunction · 0.80
patchFunction · 0.80

Calls 2

beginMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected