C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Array Index in Range-based For Loops

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Thu, 2 Mar 2023 00:53:52 +0000
On Wed, 1 Mar 2023, 20:48 Ray Gardener via Std-Proposals, <
std-proposals_at_[hidden]> wrote:

> Not gonna lie, if I see code exploiting integer overflow, I reject it. It
> just smells hoity-toity. I like code to be dead obvious.
>
> And as for assigning negative numbers to unsigned types, whatever happened
> to type safety?
>

Would you prefer -1zu then? That's a literal of type size_t so there's no
negative number and no question of it being not "type safe". It means
exactly the same thing though.

Received on 2023-03-02 00:54:08