Array fill performance differences between for, foreach, slice

Adam D. Ruppe destructionator at gmail.com
Wed Apr 1 15:11:13 UTC 2020


On Wednesday, 1 April 2020 at 15:04:44 UTC, Jesse Phillips wrote:
> It is nice that bounds checks remain in place when using 
> release and the code is @safe.

Yeah, it used to be even worse than it is now, but it is still a 
terrible switch that should NEVER be used. There are always 
better ways and we should stop telling people to use it.

The newer `-check` and `-boundscheck` switches give more 
fine-grained control if you need it (and you again never should, 
since you can control on a per-expression basis with @trusted and 
the .ptr attribute.)


More information about the Digitalmars-d-learn mailing list