On Saturday, 6 July 2013 at 18:26:28 UTC, Artur Skawina wrote:
This is slicing a local static array and returning that slice, which points to the stack and lives only until the lambda returns.
Yes, but certainly simple parameter pack expansion shouldn't be this brittle. I want to be able to write:
foo(getArray(v)[]...); // v is a parameter pack (1, 2, 3) And be confident in that it gets simply re-written as: foo(getArray(v[0])[], getArray(v[1])[], getArray(v[2])[]); It's easy to conceptualise and easy to get it right.
