Wed, 18 Nov 2009 18:38:25 -0500, Robert Jacques wrote:
> On Wed, 18 Nov 2009 15:01:10 -0500, Stewart Gordon <[email protected]>
> wrote:
>
>> Robert Jacques wrote:
>> <snip>
>>> However, I imagine tuple(a++,b++) would have some overhead, which is
>>> exactly what someone is trying to avoid by using custom for loops.
>> <snip>
>>
>> Even if tuples do have an overhead, it would be a naive compiler that
>> generates it in cases where nothing is done with it.
>>
>> Stewart.
>
> Actually, as the current compiler knows nothing about tuples, I'd have
> to call it very naive with respect to tuple optimization. :)
It does. Try
$ strings dmd
on *nix or compiling the following code:
template Tuple(T...) { alias T Tuple; }
int a, b;
Tuple!(a, b) = Tuple!(1,2);