Encapsulate arguments

Simen Kjærås simen.kjaras at gmail.com
Thu Jan 2 07:35:30 PST 2014


On 2014-01-02 02:44, Adam D. Ruppe wrote:
> On Thursday, 2 January 2014 at 01:07:01 UTC, alex burton wrote:
>> Thanks but won't the struct be copied at every function call then ?
>
> Yeah (unless the compiler optimizes it out), but that's not a big deal,
> and might even be better, since the fields need to be loaded anyway and
> doing it through a pointer might be a waste.
>
> But normal function arguments are copied anyway, so it is no loss.

Also, if copying is problematic, use ref.

--
   Simen


More information about the Digitalmars-d mailing list