3 ms·
If Zig does not have a |*const item| syntax, maybe adding it would be a good idea (and also satisfy your concern)? (Zig already has a concept of mutable and co
by loeg 3y ago
If Zig does not have a |*const item| syntax, maybe adding it would be a good idea (and also satisfy your concern)? (Zig already has a concept of mutable and const pointers.)
For example, in C++ I would distinguish between mutating iteration and non-mutating iteration like this:
for (const auto& item : collection) {} // non-mutating
for (auto& item : collection) {} // mutating