Very hacky solution to class private members
Mathias LANG
pro.mathias.lang at gmail.com
Thu Jun 9 10:59:53 UTC 2022
On Thursday, 9 June 2022 at 10:40:01 UTC, bauss wrote:
> [...]
>
> Might as well just make everything public then, right? Why stop
> there. Removing private, protected, package etc. is the way to
> go then?
>
> [...]
I still don't understand why people still don't get this: The
module is the unit of encapsulation in D. If you want your class
to be truly inaccessible, put it in its own module. Don't follow
Phobos' example: Keep your modules small.
More information about the Digitalmars-d
mailing list