hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9.5K
active users

Šimon Tóth

The range-for-loop is a very convenient replacement for the C-style for-loop.

However, range-for-loop can be cumbersome when accessing the original index or computing a target index.

The C++23 std::views::enumerate removes this problem by producing a range of tuples, where the i-th tuple consists of the value i and a reference to the i-th element of the source range.

Compiler Explorer link: compiler-explorer.com/z/84b6ns