Required Reading: "How Non-Member Functions Improve Encapsulation"
Jacob Carlborg
doob at me.com
Fri Oct 27 07:36:45 UTC 2017
On 2017-10-26 12:42, Kagamin wrote:
> You mean non-member functions are preferred? I encountered this more
> from performance point: especially in case of small structures like
> Point it would be more beneficial to pass them by value than by
> reference, which can be achieved by extension methods, but then you need
> to import the respective module to have those extension methods
> available.
Adding methods to a struct will not increase its size.
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list