MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / erase

Method erase

dependencies/json/json.hpp:16551–16568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16549 }
16550
16551 size_type erase(const Key& key)
16552 {
16553 for (auto it = this->begin(); it != this->end(); ++it)
16554 {
16555 if (it->first == key)
16556 {
16557 // Since we cannot move const Keys, re-construct them in place
16558 for (auto next = it; ++next != this->end(); ++it)
16559 {
16560 it->~value_type(); // Destroy but keep allocation
16561 new (&*it) value_type{std::move(*next)};
16562 }
16563 Container::pop_back();
16564 return 1;
16565 }
16566 }
16567 return 0;
16568 }
16569
16570 iterator erase(iterator pos)
16571 {

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected