| 344 | // Test smart pointer move semantics (unique_ptr, shared_ptr, optional, variant, expected) |
| 345 | template<typename SmartPtr> |
| 346 | void test_smart_pointer_move_semantics() { |
| 347 | auto ptr = make_shared_int(200); |
| 348 | |
| 349 | SmartPtr source(ptr); |
| 350 | |
| 351 | FL_REQUIRE(ptr.use_count() == 2); |
| 352 | |
| 353 | SmartPtr destination; |
| 354 | destination = fl::move(source); |
| 355 | |
| 356 | // Retrieve and check value, but let it go out of scope immediately |
| 357 | { |
| 358 | auto retrieved = retrieve(destination); |
| 359 | FL_CHECK(*retrieved == 200); |
| 360 | } |
| 361 | FL_CHECK(ptr.use_count() == 2); |
| 362 | } |
| 363 | |
| 364 | // Test basic iterator support for containers with shared_ptr<int> |
| 365 | // Verifies: begin/end, forward iteration, const iteration, move leaves empty |
nothing calls this directly
no test coverage detected