struct, ref in, and UFCS

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 1 00:53:25 PDT 2014


Puming:

> is this a good practice to use `ref in` with structs instead of 
> traditional pointer syntax (which does not play well with UFCS 
> though) ? Is there any perfomance implications with `ref in`? I 
> tried that it does not seem to copy the parameter value,

A "ref" is equivalent to a pointer that can't be null, so 
performance is the same as using a pointer (so it's good for 
larger structs, but not good if your struct is tiny).

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list