www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - is public the default or not?

reply Tower Ty <tytower hotmail.com> writes:
is public the default or not?

If so why are all the functions/methods in dwthelper.utils.d marked private .
Does that do something that I have missed or are they just superfluous?

some are public static
May 23 2008
parent Robert Fraser <fraserofthenight gmail.com> writes:
Tower Ty wrote:
 is public the default or not?
 
 If so why are all the functions/methods in dwthelper.utils.d marked private .
Does that do something that I have missed or are they just superfluous?
 
 some are public static
Public is the default. If members are private it is an error to access them from outside the module. Marking something "public" at the module level (or anywhere else it would be public by default) helps readability.
May 23 2008