| 909 | // Verifies: const_iterator works with find |
| 910 | template<template<typename, typename> class MapTemplate> |
| 911 | void test_map_const_iterators() { |
| 912 | using MapContainer = MapTemplate<int, fl::shared_ptr<int>>; |
| 913 | |
| 914 | MapContainer m; |
| 915 | populate_map(m, 7, make_shared_int(77)); |
| 916 | populate_map(m, 8, make_shared_int(88)); |
| 917 | |
| 918 | const MapContainer& const_m = m; |
| 919 | |
| 920 | // Const find |
| 921 | auto const_it = const_m.find(7); |
| 922 | FL_CHECK(const_it != const_m.end()); |
| 923 | FL_CHECK(const_it->first == 7); |
| 924 | FL_CHECK(*const_it->second == 77); |
| 925 | |
| 926 | // Const iteration |
| 927 | int count = 0; |
| 928 | for (auto it = const_m.begin(); it != const_m.end(); ++it) { |
| 929 | count++; |
| 930 | } |
| 931 | FL_CHECK(count == 2); |
| 932 | } |
| 933 | |
| 934 | // Test lower_bound and upper_bound |
| 935 | // Verifies: binary search operations return valid iterators |
nothing calls this directly
no test coverage detected