On Saturday, 3 September 2016 at 14:40:37 UTC, Martin Nowak wrote:
Yes, it does help. As private prevents usage outside of a module it allows to do some optimizations that required whole program analysis otherwise, e.g. variables and functions can get internal linkage, thus reducing loads/stores and indirect calls.

This doesn't really work that easily due to templates that depend on private data, and private data being referenced from alias parameters.

Of course, all such cases can still be statically detected when compiling the module in question, but this is quite a bit less trivial than just looking at the protection level.

 — David

Reply via email to