By ref and by pointer kills performance.

deadalnix deadalnix at gmail.com
Tue Feb 13 15:54:43 UTC 2024


On Tuesday, 13 February 2024 at 15:11:58 UTC, Patrick Schluter 
wrote:
> Yes, that's normal. The compiler cannot know from the 
> declaration alone if your pointer overlaps. In C you can 
> declare the pointers with restrict which will tell the compiler 
> that the pointers don't overlap. I don't know why D doesn't 
> support restrict.

It's a major footgun without much benefit. In this case, one 
could load the integers in a local variable and use the value 
from there, and you'd get teh same effet.


More information about the Digitalmars-d mailing list