[fpc-devel] Question on constref

Bart bartjunk64 at gmail.com
Wed Feb 1 13:07:43 CET 2023


On Wed, Feb 1, 2023 at 11:56 AM Adriaan van Os via fpc-devel
<fpc-devel at lists.freepascal.org> wrote:

> That is wrong. It should read
>
> "A const parameter is be passed by reference or (for small-sized parameters) by value, whatever is
> most efficient. A constref parameter is guaranteed to be passed by reference in all cases. The
> latter is therefore typically used for interfacing with external code or when writing assembler
> routines."
>
> In your case, constref is the right choice, although const would be fine also (as your
> datastructure is larger than a small number of bytes).
>

Thank you.


-- 
Bart


More information about the fpc-devel mailing list