C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Signed sizes

From: Olaf van der Spek <ml_at_[hidden]>
Date: Tue, 10 Dec 2024 21:16:15 +0100
On Tue, Dec 10, 2024 at 5:01 AM Jeremy Rifkin via Std-Proposals
<std-proposals_at_[hidden]> wrote:
> In the specific case of std::views::enumerate, one option would be to
> add a variation that produces unsigned indexes. This, plasters over
> the underlying issue and could lead ot more confusion about mixing,
> however, it would alleviate some issues.
>
> The other option would be a bigger plan to deprecate and remove
> unsigned indexing APIs and replace them with signed APIs:

A third option would be to introduce one or more new types.
For example unsigned types with a bit less and without modulo
semantics, such that they can always convert to signed types. This
would allow you to mix and match these with signed types without
issues.

Received on 2024-12-10 20:16:28