Multiple return values...

Timon Gehr timon.gehr at gmx.ch
Thu Mar 15 10:42:31 PDT 2012


On 03/15/2012 04:32 PM, Andrei Alexandrescu wrote:
>>
>
> One note - the code is really ingenious, but I still prefer swap() in
> this case. It's more concise and does less work in the general case.
>
> swap(a[i + k], a[j + j]);
>
> only computes the indexing once (in source, too).

In the general case, the alias tuple approach does less work, because it 
does not work. to!(a[i+k], a[j+j]) = from(a[j+j],a[i+k]); is illegal.


More information about the Digitalmars-d mailing list