C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Signed sizes

From: Tiago Freire <tmiguelf_at_[hidden]>
Date: Wed, 11 Dec 2024 11:34:31 +0000
> Who said they're confused? I certainly didn't.

Ok, so we agree that conversions between “distances between indexes” and “indexes” are trivial and hence not a problem?


> All I said was that I've used negative indices with pointers and other random access iterators. A quick visit to Debian code search shows I'm not alone.

Which is fine.
But would you agree that it is still not valid for standard containers, which was OP’s target?


> As Oliver said, there's no objectively right answer, and no clear consensus, but just insisting that people are wrong to weigh the trade-offs differently isn't helpful. There are valid arguments for preferring signed and for preferring unsigned. We should accept we need to make a trade-off and then aim to reduce unsafe traps that people can fall into.

Agree, the outcome won’t change because of that.

Received on 2024-12-11 11:34:35