Do non-member functions improve encapsulation in D?

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 21 08:10:02 PDT 2014


On 4/21/14, 8:08 AM, Steven Schveighoffer wrote:
> Sure, but Lars' point that it completely precludes the encapsulation
> mechanism that Scott is advocating, is true. You would have to put the
> functions outside the core module to give them the same isolation as
> non-friend C++ global functions.
>
> Note, I'm with you that the current mechanism is the "right way." It
> just completely prevents that technique of encapsulation :)
>
> -Steve

Got it, thanks. -- Andrei


More information about the Digitalmars-d mailing list