Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 220
Gary Willoughby Avatar asked Dec 05 '11 23:12

Gary Willoughby


1 Answers

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

like image 54
ratchet freak Avatar answered Sep 24 '22 20:09

ratchet freak