bearophile can say "i told you so" (re uint->int implicit conv)

Walter Bright newshound2 at digitalmars.com
Tue Apr 2 13:32:21 PDT 2013


On 4/2/2013 12:47 PM, Andrei Alexandrescu wrote:
> I used to lean a lot more toward this opinion until I got to work on a C++
> codebase using signed integers as array sizes and indices. It's an pain all over
> the code - two tests instead of one or casts all over, more cases to worry
> about... changing the code to use unsigned throughout ended up being an
> improvement.

For example, with a signed array index, a bounds check is two comparisons rather 
than one.



More information about the Digitalmars-d mailing list