rvalue references

Jonathan M Davis jmdavisProg at gmx.com
Thu Apr 25 15:39:38 PDT 2013


On Wednesday, April 24, 2013 16:48:59 Timon Gehr wrote:
> On 04/24/2013 04:56 AM, Jonathan M Davis wrote:
> >...
> >
> > However, the problem with simply making auto ref do this for non-templated
> > functions is that then it functions fundamentally differently for
> > templated and non-templated functions. ...
> 
> http://forum.dlang.org/thread/ylebrhjnrrcajnvtthtt@forum.dlang.org?page=12#p
> ost-kl8m2e:24i7g:241:40digitalmars.com

So, you're basically suggesting that auto ref on templated functions continues 
to function as it has been, except that when the compiler is able to determine 
that it could use the same approach as we'd use for non-templated functions 
without affecting the semantics of the function that that approach is used 
instead? That may be a good approach, though it does require the compiler to 
be smarter, which probably won't go well (at least initially). It _would_ 
allow us to avoid needing a new attribute though.

- Jonathan M Davis


More information about the Digitalmars-d mailing list