4 ms·
Given both Lua and python use a enumerator, the C++ example isn't really the correct equivalent. for (auto [i, v] : std::views::enumerate(vec)) { std::
by HeavyStorm 3mo ago
Given both Lua and python use a enumerator, the C++ example isn't really the correct equivalent.
for (auto [i, v] : std::views::enumerate(vec)) {
std::cout << i << ": " << v << '\n';
}
This is how you'd do it.
- ziotom78 3mo agoTrue, but this is C++23, while the post is about C++20.