Where can I read more about D's class access modifiers?

回眸只為那壹抹淺笑 提交于 2019-12-10 14:50:12

问题


I can't seem to find a good reference for the D programming language class access modifiers.

I know that public and private are pretty much guaranteed but i'm guessing there are more, i just can't seem to find a good source of information.

Can anyone point me to a good reference please?


回答1:


You can check the official reference at dlang.org

in short:

  • private, is only accessible in the same module (file)

  • package, is only accessible in the same package

  • protected, is module + inherited classes

  • public (also the default) is accessible every where

  • export is use to export functions when you are writing libraries



来源:https://stackoverflow.com/questions/8393372/where-can-i-read-more-about-ds-class-access-modifiers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!