Efficiently passing structs

bitwise via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 5 08:36:18 PDT 2015


On Tue, 05 May 2015 10:44:13 -0400, rsw0x <anonymous at anonymous.com> wrote:

> On Tuesday, 5 May 2015 at 14:14:51 UTC, bitwise wrote:
>> Interesting.. Has this always worked? Theres a couple of forum  
>> conversations about trying to get "auto ref" to work for non-templates.  
>> The main problem seems to be that auto ref wont work for virtual  
>> functions.
>
> I know its worked for a while, I often use it when I'm too lazy to put  
> attributes in and just have the templates infer them for me ;)

Nice ;)

>> Also, I don't see how someone could arrive at the above solution  
>> without showing up here and asking first.
>>
>
> You're probably right, maybe someone should submit a PR to  
> https://github.com/p0nce/d-idioms/

I was actually thinking of trying to add it to the table here:

http://dlang.org/function.html#parameters

It's on the template page, but as it is truly the only way to ensure  
structs are passed efficiently, it may be a good idea to add a link, or  
some text on this page as well.


More information about the Digitalmars-d-learn mailing list