The liabilities of binding rvalues to ref

Peter Alexander peter.alexander.au at gmail.com
Sun May 5 05:11:47 PDT 2013


On Sunday, 5 May 2013 at 11:55:28 UTC, Timon Gehr wrote:
> I still think auto ref should be extended to work for 
> non-templated functions. The semantics should be the same (i.e. 
> behave as if there were two copies that are eagerly 
> semantically analyzed, but only generate code for one) where 
> possible.

This is not the case currently for template auto ref functions. 
For example, the two "versions" of the auto ref function do not 
share local static variables, nor do they have the same function 
address. They are literally two (or four, or eight, ...) separate 
functions. I really dislike how they have been implemented.



More information about the Digitalmars-d mailing list