Using closure in function scope to make "real" private class members

Basile B. b2.temp at gmx.com
Tue Jun 7 10:40:41 UTC 2022


On Tuesday, 7 June 2022 at 10:13:35 UTC, Ola Fosheim Grøstad 
wrote:
> Encapsulation is not absolute in D, and can never be. You can 
> just cast the pointer to a different type and you'1l get full 
> access to everything from anywhere.

Also interfaces break visibility with joy. If an interface 
implementer implements one of the func as private, you can still 
use it, whatever is the call site.



More information about the Digitalmars-d mailing list