Boost logo

Boost :

Subject: Re: [boost] Current Guidance on Compiler Warnings?
From: Peter Dimov (lists_at_[hidden])
Date: 2018-11-26 23:05:50


Gavin Lambert wrote:
> On 27/11/2018 03:21, Alexander Grund wrote:
> > I might agree with the size_t mistake: Using it for sizes may be ok, but
> > as an index type might have been wrong.
>
> As an index for a vector or array which cannot have a valid index below
> zero, it's perfectly fine.

It's not perfectly fine, because you can pass a negative index to it and
there's no way to check for that (from within the function). If you take a
signed type, you can assert.

It seems that we need to go over this at least once per year.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk