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: > Thi

Re: struct init() method

2012-02-26 Thread Alex Rønne Petersen
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: struct S{ @disable enum init = 0; } I thought that the way

Re: struct init() method

2012-02-26 Thread Jonathan M Davis
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: > >> > >> struct S{ > >> > >> @disable enum init = 0; > >> > >> } > > > > I thought that the way tha

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();} v

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: s

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{ > > >> > > >>

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

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 purpose

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 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 th

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; //(*foos[0]).i

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 > >

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 t

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 na