My Reference Safety System (DIP???)

Zach the Mystic via Digitalmars-d digitalmars-d at puremagic.com
Mon Mar 2 14:21:09 PST 2015


On Monday, 2 March 2015 at 22:00:56 UTC, deadalnix wrote:
> You don't put the ownership acquire at the same place, but that 
> is the same idea. It is probably even better to do it your way 
> (or is it ?).

Yes. Unless the compiler detects that you duplicate a variable in 
two parameters in the same call, you literally have *no* added 
cycles, anywhere:

fun(c, c.c);

This is the only time you pay any penalty (except for passing 
globals, as we now realize, since all globals can alias 
themselves as parameters -- nasty).


More information about the Digitalmars-d mailing list