| 527 | // Erase operations for map containers |
| 528 | template<typename Map> |
| 529 | void test_map_erase() { |
| 530 | Map m; |
| 531 | m.insert(fl::make_pair(1, 100)); |
| 532 | m.insert(fl::make_pair(2, 200)); |
| 533 | m.insert(fl::make_pair(3, 300)); |
| 534 | |
| 535 | FL_CHECK(m.size() == 3); |
| 536 | |
| 537 | // Erase by key |
| 538 | auto count = m.erase(2); |
| 539 | FL_CHECK(count == 1); |
| 540 | FL_CHECK(m.size() == 2); |
| 541 | FL_CHECK(m.find(2) == m.end()); |
| 542 | } |
| 543 | |
| 544 | // Iteration for map containers |
| 545 | template<typename Map> |