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