Comment

Comment by HeavyStorm

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.
parent HeavyStorm 3 months ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton