UFCS for D

Walter Bright newshound2 at digitalmars.com
Thu Mar 29 17:27:46 PDT 2012


On 3/29/2012 5:09 PM, Steven Schveighoffer wrote:
> The reason being, if you change anything in class A, you do not have to worry
> about the implementation of getXSquared, because it simply has no access to the
> private implementation. You only have to worry about internal methods, and
> friend functions.

Ok, I see what you're talking about. It has nothing to do with UFCS, it is D's 
design decision to not have explicit friends, but to make everything in a module 
implicitly a friend.

I think it's far superior to the explicit friend thing in C++.

I've never seen much cause for hiding things within the same module. It's not 
like you're allowed to edit one part of the file and not touch another part.


More information about the Digitalmars-d-announce mailing list