Deprecation: foreach: loop index implicitly converted from size_t to int

Michael michael at toohuman.io
Fri Jan 18 12:27:17 UTC 2019


Hello all,

I am getting this deprecation warning when compiling using DMD64 
D Compiler v2.084.0 on Linux. I'm a little unsure what the 
problem is, however, because the code producing these warnings 
tends to be of the form:

> foreach (int i, ref prop; props)

This, to be, looks like quite the explicit conversion, no? Does 
it mean I now have to use to!int(i) to convert the type of i in a 
foreach now?

Thanks,
Michael.


More information about the Digitalmars-d-learn mailing list