> Le 8 avr. 2017 à 00:45, Jordan Rose <[email protected]> a écrit : > > >> On Apr 7, 2017, at 04:18, Gwendal Roué via swift-evolution >> <[email protected]> wrote: >> >> - the private/fileprivate qualifier used not to be a intrinsic property of >> an object (because one had to move from private to fileprivate as soon as an >> extension was added). Now private/fileprivate can be made meaningful, and >> above all *stable*. A scenario where private is turned into a fileprivate >> now involves something called "friendship" in C++: fileprivate now reflects >> *actual design intent*, not "shut up this stupid compiler". > > I, uh, wish to object to your implication that C++ 'friend' reflects actual > design intent in most cases. :-)
I have used C++ `friend`, like 15 years ago, and I can't say I lack it today! Still, under this proposal, Swift's `fileprivate` will cover some use cases of C++ `friend`, and also `protected`: after all, some blessed types or subclasses will have access to some otherwise unavailable members. If I'm right, we should see "Swift fileprivate considered harmful" posts sooner or later :-) BTW - I've just realized that I've voted twice on this proposal - apologies! Gwendal _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
