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