On 12/17/12, Dan <[email protected]> wrote: > Is it an optimization?
I think it is. You can get rid of auto ref and you'll see it still doesn't copy for the second case, e.g. change signature to: void foo(S t); And only this call copies: foo(s); This one doesn't copy: foo(S(['x', 'y', 'z'])); The optimization makes sense since this object doesn't exist outside the foo function. Btw, you might want to use `char[] c;`, not `char c[];` since that syntax will eventually be deprecated.
