| 365 | // Verifies: begin/end, forward iteration, const iteration, move leaves empty |
| 366 | template<typename Container> |
| 367 | void test_container_iterators_with_shared_ptr() { |
| 368 | auto ptr1 = make_shared_int(10); |
| 369 | auto ptr2 = make_shared_int(20); |
| 370 | auto ptr3 = make_shared_int(30); |
| 371 | |
| 372 | Container source; |
| 373 | populate(source, ptr1); |
| 374 | populate(source, ptr2); |
| 375 | populate(source, ptr3); |
| 376 | |
| 377 | // Test mutable iterators exist |
| 378 | FL_CHECK(source.begin() != source.end()); |
| 379 | |
| 380 | // Test const iterators via const reference |
| 381 | const auto& const_source = source; |
| 382 | FL_CHECK(const_source.begin() != const_source.end()); |
| 383 | |
| 384 | // Move and verify source is empty via iterators |
| 385 | Container destination = fl::move(source); |
| 386 | FL_CHECK(source.begin() == source.end()); // Empty after move |
| 387 | const auto& const_empty = source; |
| 388 | FL_CHECK(const_empty.begin() == const_empty.end()); |
| 389 | FL_CHECK(destination.begin() != destination.end()); // Has elements |
| 390 | } |
| 391 | |
| 392 | // Test reverse iterator support for bidirectional containers |
| 393 | // Verifies: rbegin/rend exist and work correctly after move |
nothing calls this directly
no test coverage detected