How to fix "typesafe variadic function parameter"?
Andrey Zherikov
andrey.zherikov at gmail.com
Tue May 24 22:54:25 UTC 2022
On Tuesday, 24 May 2022 at 22:51:50 UTC, Adam Ruppe wrote:
> On Tuesday, 24 May 2022 at 22:46:55 UTC, Andrey Zherikov wrote:
>> return S(s);
>
> return S(s.dup);
>
>
> The variadic lives in a temporary array that expires at the end
> of the function. So copying it out to the GC lets it live on.
>
> Your code was wrong on 2.099 too, but the compiler didn't tell
> you.
That works, thank you!
Can this error message be improved some way so this fix becomes
obvious?
More information about the Digitalmars-d-learn
mailing list