How to fix "typesafe variadic function parameter"?

Adam Ruppe destructionator at gmail.com
Tue May 24 22:51:50 UTC 2022


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.



More information about the Digitalmars-d-learn mailing list