Thoughts on possible tuple semantics

deadalnix deadalnix at gmail.com
Wed Aug 21 09:51:10 PDT 2013


On Wednesday, 21 August 2013 at 16:19:43 UTC, Dicebot wrote:
> Hm, the wording feels wrong now. No, here is the idea:
> auto a = tuple(1, 2);
> foo(a, 3); // rejected
> foo(a.expand, 3); // works
>
> "T..." here simply says, "work with T as it is a tuple but it 
> is a normal function argument list in fact".
>
> so no packing actually happens here: "foo(1, 2, 3)", my mistake

My concern here is to keep the foo(T...)(T args) equivalent to 
template foo(T...) { foo(T args) }

We also need to be more precise about what we mean when saying 
packing/unpacking.


More information about the Digitalmars-d mailing list