Re: Classes and @disable this()

2015-02-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/10/15 12:15 PM, Jonathan M Davis via Digitalmars-d-learn wrote: On Tuesday, February 10, 2015 11:16:21 via Digitalmars-d-learn wrote: On Monday, 9 February 2015 at 20:15:28 UTC, Jonathan M Davis Why would it we even allow it? What benefit is there? It's meaningless. @disable this(); is for

Re: Classes and @disable this()

2015-02-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, February 10, 2015 11:16:21 via Digitalmars-d-learn wrote: > On Monday, 9 February 2015 at 20:15:28 UTC, Jonathan M Davis > > Why would it we even allow it? What benefit is there? It's > > meaningless. > > @disable this(); is for disabling the init property on structs. > > Classes > > th

Re: Classes and @disable this()

2015-02-10 Thread via Digitalmars-d-learn
On Monday, 9 February 2015 at 20:15:28 UTC, Jonathan M Davis wrote: On Monday, February 09, 2015 13:29:22 Steven Schveighoffer via Digitalmars-d-learn wrote: On 2/8/15 2:57 PM, Jonathan M Davis via Digitalmars-d-learn wrote: > On Sunday, February 08, 2015 17:51:09 bearophile via > Digitalmars-d

Re: Classes and @disable this()

2015-02-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, February 09, 2015 15:25:14 Steven Schveighoffer via Digitalmars-d-learn wrote: > Well, if I do this: > > class C {} > > I can do this: > > new C(); > > Mechanisms to disable this are kind of awkward. I can define this() as > private, but that doesn't help for intra-module calls. > > sta

Re: Classes and @disable this()

2015-02-10 Thread bearophile via Digitalmars-d-learn
I think this can be filed in Bugzilla as diagnostic enhancement: class Foo { @disable this(); this(int i) {} } void main() {} https://issues.dlang.org/show_bug.cgi?id=14163 Bye, bearophile

Re: Classes and @disable this()

2015-02-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/9/15 3:15 PM, Jonathan M Davis via Digitalmars-d-learn wrote: On Monday, February 09, 2015 13:29:22 Steven Schveighoffer via Digitalmars-d-learn wrote: On 2/8/15 2:57 PM, Jonathan M Davis via Digitalmars-d-learn wrote: On Sunday, February 08, 2015 17:51:09 bearophile via Digitalmars-d-lea

Re: Classes and @disable this()

2015-02-09 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, February 09, 2015 13:29:22 Steven Schveighoffer via Digitalmars-d-learn wrote: > On 2/8/15 2:57 PM, Jonathan M Davis via Digitalmars-d-learn wrote: > > On Sunday, February 08, 2015 17:51:09 bearophile via Digitalmars-d-learn > > wrote: > >> fra: > >> > >>> However making it a compiler

Re: Classes and @disable this()

2015-02-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/8/15 2:57 PM, Jonathan M Davis via Digitalmars-d-learn wrote: On Sunday, February 08, 2015 17:51:09 bearophile via Digitalmars-d-learn wrote: fra: However making it a compiler error would be far, far better I think this can be filed in Bugzilla as diagnostic enhancement: class Foo {

Re: Classes and @disable this()

2015-02-09 Thread via Digitalmars-d-learn
On Sunday, 8 February 2015 at 19:57:28 UTC, Jonathan M Davis wrote: On Sunday, February 08, 2015 17:51:09 bearophile via Digitalmars-d-learn wrote: fra: > However making it a compiler error would be far, far better I think this can be filed in Bugzilla as diagnostic enhancement: class Foo

Re: Classes and @disable this()

2015-02-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, February 08, 2015 17:51:09 bearophile via Digitalmars-d-learn wrote: > fra: > > > However making it a compiler error would be far, far better > > I think this can be filed in Bugzilla as diagnostic enhancement: > > > class Foo { > @disable this(); > this(int i) {} > } > void ma

Re: Classes and @disable this()

2015-02-08 Thread bearophile via Digitalmars-d-learn
fra: However making it a compiler error would be far, far better I think this can be filed in Bugzilla as diagnostic enhancement: class Foo { @disable this(); this(int i) {} } void main() {} Bye, bearophile

Re: Classes and @disable this()

2015-02-08 Thread Rene Zwanenburg via Digitalmars-d-learn
On Sunday, 8 February 2015 at 16:28:21 UTC, fra wrote: On Sunday, 8 February 2015 at 16:22:36 UTC, fra wrote: Missclick... Anywya: class Something { @disable this(); this(int i) {} } produces an undefined reference error. I guess it has to do with classes implicitly inheriting from Objec

Re: Classes and @disable this()

2015-02-08 Thread fra via Digitalmars-d-learn
On Sunday, 8 February 2015 at 16:22:36 UTC, fra wrote: Missclick... Anywya: class Something { @disable this(); this(int i) {} } produces an undefined reference error. I guess it has to do with classes implicitly inheriting from Object, and Object defining a this(), and @disable telling th