| 5 | #include <vector> |
| 6 | |
| 7 | int main() |
| 8 | { |
| 9 | std::vector<int> v{2, 3, 4, 5, 6}; // #A |
| 10 | |
| 11 | size_t idx{0}; // #B Belongs to the for but is in outer scope |
| 12 | for(const auto& e : v) { |
| 13 | // #C Show the position using idx |
| 14 | printf("[%zd] %d\n", idx++, e); |
| 15 | } |
| 16 | } |
nothing calls this directly
no outgoing calls
no test coverage detected