| 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 | { |
no test coverage detected