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