Wishlist proposal, documenting fn arg as in or out or mod
user456
user456 at 123.de
Tue Jun 20 17:15:47 UTC 2023
On Tuesday, 20 June 2023 at 15:56:55 UTC, Dom DiSc wrote:
> On Tuesday, 20 June 2023 at 15:01:17 UTC, Cecil Ward wrote:
>
>> void myfn( in T1 InputArg, in const ref InputArray1, rw
>> Modify, out result )
>
> why not
>
> ```d
> void myfn(in T1 InputArg, const ref T2 InputArray1, ref T3
> Modify, out T4 result);
> ```
>
> a "const ref" is of course read only, and a simple "ref" is
> expected to be modified by the function (else you would have
> made it const, wouldn't you?).
`const ref` vs `const` is about the size of the parameter.
Also maybe a bit about the position in the parameter list.
More information about the Digitalmars-d
mailing list