Multiple return values...

Manu turkeyman at gmail.com
Fri Mar 16 11:03:18 PDT 2012


On 16 March 2012 19:53, Timon Gehr <timon.gehr at gmx.ch> wrote:

> On 03/16/2012 06:33 PM, Manu wrote:
>
>> On 16 March 2012 18:37, Andrei Alexandrescu
>> <SeeWebsiteForEmail at erdani.org <mailto:SeeWebsiteForEmail@**erdani.org<SeeWebsiteForEmail at erdani.org>
>> >>
>>
>> wrote:
>>
>>    Actually, as has been mentioned, swizzling can be done very nicely
>>    inside the language.
>>
>>
>> How?
>>
>
> Use opDispatch.
>
> a = a.yxwz;


The simplest possible example (I've done this is std.simd)... but if I have
a few different loosely related things?
My personal most frequent problem case is collision/physics. pos, 't',
velocity, intersectionFlag, intersection target pointer, etc.. lots of
loosely related stuff, always results in inefficient function calls in some
of the hottest code in the engine.


DMD does that for you (Walter is the inventor of NRVO).
>

Which is awesome for returning larger structs, but not good for returning
just a couple of unrelated things that will persist as locals in the
calling function.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120316/58a9df7e/attachment-0001.html>


More information about the Digitalmars-d mailing list