| 446 | // Insert/erase operations |
| 447 | template<template<typename> class ContainerTemplate> |
| 448 | void test_insert_and_erase() { |
| 449 | using Container = ContainerTemplate<TestItem>; |
| 450 | Container container; |
| 451 | container.push_back(fl::move(TestItem(10))); |
| 452 | container.push_back(fl::move(TestItem(30))); |
| 453 | FL_CHECK(container.size() == 2); |
| 454 | |
| 455 | // Insert at position 1 |
| 456 | auto it = container.begin(); |
| 457 | ++it; |
| 458 | TestItem item(20); |
| 459 | int initial_move_count = item.move_count; |
| 460 | container.insert(it, fl::move(item)); |
| 461 | |
| 462 | FL_CHECK(container.size() == 3); |
| 463 | FL_CHECK(item.move_count > initial_move_count); |
| 464 | |
| 465 | // Erase middle element |
| 466 | it = container.begin(); |
| 467 | ++it; |
| 468 | container.erase(it); |
| 469 | FL_CHECK(container.size() == 2); |
| 470 | } |
| 471 | |
| 472 | // ============================================================================ |
| 473 | // Map Container Test Functions (PATTERN 2: Concrete Container Type) |