On Wed, 17 Feb 2010 16:58:35 +0300, dsimcha <[email protected]> wrote:

== Quote from Denis Koroskin ([email protected])'s article
IIRC, it was discussed before and the following solution was suggested:
T[] toArray(T)(T[] values...)
{
     return values.dup; // not sure why dup is needed here, but DMD2.039
complains about escaping reference

When using this kind of variadics, an implementation is allowed to allocate the
array on the stack for performance.  Therefore, you were trying to escape
references to a stack-allocated array.

Oh, great! Didn't know the fact, thanks!

Reply via email to