DIP77 - Fix unsafe RC pass by 'ref'

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 10 00:01:08 PDT 2015


On 4/9/2015 10:56 PM, "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= 
<ola.fosheim.grostad+dlang at gmail.com>" wrote:
> So if I pass in a graph, linked list or a tree, then it will scan the entire
> structure at runtime and build a large set of temporaries before calling the
> function?


Nope. It'll scan at compile time the types reachable through the parameters. If 
any of those types are RCO's that have a type that matches a ref parameter, the 
ref parameter's RCO will get copied.


More information about the Digitalmars-d mailing list