MCPcopy Create free account
hub / github.com/andreasfertig/programming-with-cpp20 / main

Function main

11.02-rangeBaseForWithInit1/main.cpp:7–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include <vector>
6
7int main()
8{
9 std::vector<int> v{2, 3, 4, 5, 6};
10
11 { // #A The scope ties idx and the loop together
12 size_t idx{0};
13 for(const auto& e : v) { printf("[%zd] %d\n", idx++, e); }
14 }
15}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected