Re:Memory Copy Hunting
by loeg on Wednesday July 26, 2023 @01:30PM
(#36881489)
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
For example, in C++ I would distinguish between mutating iteration and non-mutating iteration like this: