C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Signed sizes

From: Thiago Macieira <thiago_at_[hidden]>
Date: Tue, 10 Dec 2024 19:26:15 -0300
On Tuesday 10 December 2024 14:50:42 Brasilia Standard Time Tiago Freire via
Std-Proposals wrote:
> var[-1] is always wrong, conceptually you are trying to access an element
> before first element of the container. I don’t need to check if this index
> is a valid index in the container, it’s just wrong.

var may be a pointer or iterator to a non-first element of a container, in
which case it is valid.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel DCAI Platform & System Engineering

Received on 2024-12-10 22:26:19