Re: struct init() method

2012-02-26 Thread Timon Gehr
On 02/26/2012 12:18 AM, Jonathan M Davis wrote: On Saturday, February 25, 2012 17:07:14 Timon Gehr wrote: This is useful: struct S{ @disable enum init = 0; } I thought that the way that you were supposed to do that was @disable this(); - Jonathan M Davis struct S{@disable this();}

Re: struct init() method

2012-02-26 Thread Jonathan M Davis
On Sunday, February 26, 2012 13:15:51 Alex Rønne Petersen wrote: On 26-02-2012 12:53, Jonathan M Davis wrote: On Sunday, February 26, 2012 12:48:06 Timon Gehr wrote: On 02/26/2012 12:18 AM, Jonathan M Davis wrote: On Saturday, February 25, 2012 17:07:14 Timon Gehr wrote: This is useful:

Re: struct init() method

2012-02-25 Thread Alex Rønne Petersen
On 25-02-2012 05:05, bearophile wrote: This program comes from a reduction of a bug I've found: struct Foo { void init() {} } void main() { Foo*[] foos; //(*foos[0]).init(); // OK foos[0].init(); // Error: function expected before (), not null of type Foo* } What do you

Re: struct init() method

2012-02-25 Thread H. S. Teoh
On Sat, Feb 25, 2012 at 01:23:21PM +0100, Alex Rønne Petersen wrote: On 25-02-2012 05:05, bearophile wrote: This program comes from a reduction of a bug I've found: struct Foo { void init() {} } void main() { Foo*[] foos; //(*foos[0]).init(); // OK foos[0].init();

Re: struct init() method

2012-02-25 Thread Timon Gehr
On 02/25/2012 04:52 PM, H. S. Teoh wrote: On Sat, Feb 25, 2012 at 01:23:21PM +0100, Alex Rønne Petersen wrote: On 25-02-2012 05:05, bearophile wrote: This program comes from a reduction of a bug I've found: struct Foo { void init() {} } void main() { Foo*[] foos;

Re: struct init() method

2012-02-25 Thread Dmitry Olshansky
On 25.02.2012 8:05, bearophile wrote: This program comes from a reduction of a bug I've found: struct Foo { void init() {} } void main() { Foo*[] foos; //(*foos[0]).init(); // OK foos[0].init(); // Error: function expected before (), not null of type Foo* } What do you

Re: struct init() method

2012-02-25 Thread Jonathan M Davis
On Saturday, February 25, 2012 17:07:14 Timon Gehr wrote: This is useful: struct S{ @disable enum init = 0; } I thought that the way that you were supposed to do that was @disable this(); - Jonathan M Davis

Re: struct init() method

2012-02-25 Thread Alex Rønne Petersen
On 26-02-2012 00:18, Jonathan M Davis wrote: On Saturday, February 25, 2012 17:07:14 Timon Gehr wrote: This is useful: struct S{ @disable enum init = 0; } I thought that the way that you were supposed to do that was @disable this(); - Jonathan M Davis Yeah, I'm not sure what

Re: struct init() method

2012-02-25 Thread H. S. Teoh
On Sun, Feb 26, 2012 at 12:23:47AM +0100, Alex Rønne Petersen wrote: On 26-02-2012 00:18, Jonathan M Davis wrote: On Saturday, February 25, 2012 17:07:14 Timon Gehr wrote: This is useful: struct S{ @disable enum init = 0; } I thought that the way that you were supposed to do that

Re: struct init() method

2012-02-25 Thread Jonathan M Davis
On Saturday, February 25, 2012 17:54:44 H. S. Teoh wrote: On Sun, Feb 26, 2012 at 12:23:47AM +0100, Alex Rønne Petersen wrote: On 26-02-2012 00:18, Jonathan M Davis wrote: On Saturday, February 25, 2012 17:07:14 Timon Gehr wrote: This is useful: struct S{ @disable enum init

Re: struct init() method

2012-02-25 Thread Alex Rønne Petersen
On 26-02-2012 02:54, Jonathan M Davis wrote: On Saturday, February 25, 2012 17:54:44 H. S. Teoh wrote: On Sun, Feb 26, 2012 at 12:23:47AM +0100, Alex Rønne Petersen wrote: On 26-02-2012 00:18, Jonathan M Davis wrote: On Saturday, February 25, 2012 17:07:14 Timon Gehr wrote: This is useful:

struct init() method

2012-02-24 Thread bearophile
This program comes from a reduction of a bug I've found: struct Foo { void init() {} } void main() { Foo*[] foos; //(*foos[0]).init(); // OK foos[0].init(); // Error: function expected before (), not null of type Foo* } What do you think about the idea of not allowing methods