Re: dcollections ArrayList pb with mixin template

2010-07-02 Thread BLS
On 02/07/2010 00:47, bearophile wrote: BLS: I don't understand (in this context) . Can you please elaborate a bit more ? I have not shown you code because I don't understand your context. But you can put inside static this() {...} code that can't be run statically, like the initialization of

Re: dcollections ArrayList pb with mixin template

2010-07-02 Thread Steven Schveighoffer
On Thu, 01 Jul 2010 18:26:06 -0400, bearophile wrote: Steven Schveighoffer: I think a member initializer has to be a constant expression, like int i = 1. Anything else has to be done in the constructor. There are the static constructors too, for modules, structs, classes. static const

Re: dcollections ArrayList pb with mixin template

2010-07-01 Thread bearophile
BLS: > I don't understand (in this context) . Can you please elaborate a bit more ? I have not shown you code because I don't understand your context. But you can put inside static this() {...} code that can't be run statically, like the initialization of a run-time thing. Bye, bearophile

Re: dcollections ArrayList pb with mixin template

2010-07-01 Thread BLS
On 02/07/2010 00:26, bearophile wrote: Steven Schveighoffer: I think a member initializer has to be a constant expression, like int i = 1. Anything else has to be done in the constructor. There are the static constructors too, for modules, structs, classes. Bye, bearophile Hi bearophile, I

Re: dcollections ArrayList pb with mixin template

2010-07-01 Thread bearophile
Steven Schveighoffer: > I think a member initializer has to be a constant expression, like int i = > 1. Anything else has to be done in the constructor. There are the static constructors too, for modules, structs, classes. Bye, bearophile

Re: dcollections ArrayList pb with mixin template

2010-07-01 Thread BLS
On 01/07/2010 22:59, Steven Schveighoffer wrote: On Thu, 01 Jul 2010 15:36:53 -0400, BLS wrote: Hi, I have a problem with a mixin template. More exact with an Arraylist!T within a mixin template. Given. void main() { auto p = new Person("Hans", 32); p ~= new Person("Steve", 40); p ~= new Perso

Re: dcollections ArrayList pb with mixin template

2010-07-01 Thread Steven Schveighoffer
On Thu, 01 Jul 2010 15:36:53 -0400, BLS wrote: Hi, I have a problem with a mixin template. More exact with an Arraylist!T within a mixin template. Given. void main() { auto p = new Person("Hans", 32); p ~= new Person("Steve", 40); p ~= new Person("Bjoern", 101); }

dcollections ArrayList pb with mixin template

2010-07-01 Thread BLS
Hi, I have a problem with a mixin template. More exact with an Arraylist!T within a mixin template. Given. void main() { auto p = new Person("Hans", 32); p ~= new Person("Steve", 40); p ~= new Person("Bjoern", 101); } class Person { private string _name;