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;

Re: dcollections ArrayList pb with mixin template

2010-07-01 Thread Steven Schveighoffer
On Thu, 01 Jul 2010 15:36:53 -0400, BLS windev...@hotmail.de 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

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 windev...@hotmail.de 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,

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

Re: Mixing operations with signed and unsigned types

2010-07-01 Thread bearophile
Stewart Gordon: That code needs to be fixed? My point was that being forced to use signed types for values that cannot possibly be negative doesn't to me constitute fixing anything. Yes, in my opinion it needs to be fixed. Using unsigned integers in D is a hazard, so if you use them where

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