Do constructors in D support the privacy keyword?

Gary Willoughby dev at nomad.so
Sat Sep 7 11:37:05 PDT 2013


Do constructors in D support a privacy keyword? I'm guessing not 
because if i declare one like this:

class T
{
     private this()
     {
     }
}

i can still instantiate the class like this:

auto x = new T();

and there is no error thrown. Am i right in thinking the privacy 
keyword is ignored?


More information about the Digitalmars-d-learn mailing list