foreach counter now must be size_t ?

Walter Bright newshound2 at digitalmars.com
Tue Feb 5 23:04:16 UTC 2019


On 2/5/2019 1:14 PM, Rubn wrote:
> WHAT. WHAT. Where do you see an assignment from size_t to int here?
> 
> int[] arr = someRandomArray();
> for( int i = 0; i < arr.length; ++i ) {
>     dg( i, arr[i] );
> }
> 
> ???

The ++i overflows and the loop never terminates.


More information about the Digitalmars-d mailing list