[dmd-beta] rvalue references

Jonathan M Davis jmdavisProg at gmx.com
Mon Apr 16 13:48:52 PDT 2012


On Monday, April 16, 2012 14:57:08 Jason House wrote:
> I believe "const scope" arguments would fall into the category of not caring
> if a copy was made or not.

scope prevents escaping references (or is supposed to anyway - I don't think 
that it actually does right now), and in the case of delegates, it allows the 
compiler to avoid allocating a closure. It's really only applicable to 
reference types, so no copying would be occuring anyway. The issue is when you 
have value types that you don't necessarily want to copy.

- Jonathan M Davis


More information about the dmd-beta mailing list