About structs and performant handling

Daniel Murphy yebblies at nospamgmail.com
Mon Mar 11 06:58:58 PDT 2013


"deadalnix" <deadalnix at gmail.com> wrote in message 
news:libldszmvkzcezcfkktx at forum.dlang.org...
> On Sunday, 10 March 2013 at 02:17:36 UTC, Daniel Murphy wrote:
>> A better way to do with would be to change (or extend) the abi, so that
>> structs over a certain size are always passed by reference with this
>> parameter type.  Then you only need one version of the function.  We 
>> could
>> use auto ref for this.
>
> Auto ref will pass any lvalue by ref, even when it don't make any sense 
> (small structs). It also expose different semantic according if an revalue 
> or an lvalue is passed. It has roughly the same issues as this thread's 
> proposal.

You're right, I was thinking about const auto ref.  const auto ref could 
pass values however it felt, and nobody would ever know. 




More information about the Digitalmars-d mailing list