> On Feb 1, 2023, at 8:16 PM, Adriaan van Os via fpc-devel 
> <fpc-devel@lists.freepascal.org> wrote:
> 
> Because, if e.g. the byte-size of a parameter is such that it fits into a CPU 
> register, then passing the parameter itself is more efficient than passing a 
> reference to it. For large byte-size parameters, const and constref function 
> the same. The difference is with small byte-size parameters.

Hmmm I was told otherwise by one of the compiler devs and that I should use 
constref if I want to guarantee it will not be copied. Maybe one of them can 
confirm this….

 I tried to use https://godbolt.org/ but my program doesn’t seem to be 
producing any output...

Regards,
Ryan Joseph

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to