News for hackers. Stuff that matters.
Re:Almost Always Unsigned by Someone on Friday July 10, 2026 @07:39AM (#48858562)
> I have a better solution: address the root cause of unsafe semantics by not using raw indexed for-loops, unless one absolutely needs an index, in which case one should generate it with std::views::enumerate.

That’s why Swift completely removed that kind of for loop (https://github.com/swiftlang/swift-evolution/blob/main/propo...)

> This stuff compiles to broadly the same assembly.

At the cost of requiring a more complex compiler. Also, C/C++ won’t find “broadly the same” sufficient. They’ll want to see the same performance.

There are no comments on this comment yet.