Re: Do constructors in D support the privacy keyword?

2013-09-08 Thread Michael
In same module private acts like friend in C++.

Do constructors in D support the privacy keyword?

2013-09-07 Thread Gary Willoughby
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?

Re: Do constructors in D support the privacy keyword?

2013-09-07 Thread H. S. Teoh
On Sat, Sep 07, 2013 at 08:37:05PM +0200, Gary Willoughby wrote: 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

Re: Do constructors in D support the privacy keyword?

2013-09-07 Thread anonymous
On Saturday, 7 September 2013 at 18:37:11 UTC, Gary Willoughby wrote: 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

Re: Do constructors in D support the privacy keyword?

2013-09-07 Thread Gary Willoughby
On Saturday, 7 September 2013 at 18:49:43 UTC, H. S. Teoh wrote: On Sat, Sep 07, 2013 at 08:37:05PM +0200, Gary Willoughby wrote: 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