[dmd-beta] D 2.059 beta 4

Nick Sabalausky bus_dmdbeta at semitwist.com
Mon Apr 9 23:41:08 PDT 2012


From: "Walter Bright" <walter at digitalmars.com>
>
> On 4/9/2012 10:51 PM, Jonathan M Davis wrote:
>> I really don't care how it's implemented for not-templated functions. It 
>> can be the outright equivalent of C++'s const& for all I care. But 
>> without auto ref on non-templated functions, we're forced to duplicate 
>> any non-templated function which takes const ref.
>
> Let's say the compiler auto-generates the following:
>
>    void foo(T t) { foo(t); }
>
> in case it sees:
>
>     void foo(ref T t) { ... }
>

No, not when it sees:

     void foo(ref T t) { ... }

It's when it sees:

     void foo(auto ref T t) { ... }



More information about the dmd-beta mailing list