On 1/21/2024 3:51 AM, zjh wrote:
When you need `friend`, You can put them all in one module.
Sometimes, when `multiple classes` are closely related and independent, `class level privacy` becomes very important. No one wants , someone from outside may secretly steal money from your home.


D does not allow a different module accessing private class members. Private access is limited to the module enclosing that class.

This encourages a different use of modules than C++ "toss code randomly into different source files."

Reply via email to