Efficiently passing structs

bitwise via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun May 3 20:57:04 PDT 2015


On Sun, 03 May 2015 22:37:52 -0400, rsw0x <anonymous at anonymous.com> wrote:
> Use the ref storage class. You can use more than one storage class i.e,
> foo(in ref int x)

Thanks, this should work.


On Sun, 03 May 2015 23:29:59 -0400, Baz <bb.temp at gmx.com> wrote:
> it's specified in http://dlang.org/abi.html (at the bottom):
>
> "out and ref are passed as pointers".

Awesome, thanks for the link.

> Maybe `const ref` is what you're looking for...

I'll probably go with "in ref". I think "escape proof" is probably a good  
default. Not to mention, easier to type ;)


More information about the Digitalmars-d-learn mailing list