Re: Problem about using struct

2012-06-25 Thread Tongzhou Li
On Monday, 25 June 2012 at 10:10:56 UTC, Kenji Hara wrote: On Monday, 25 June 2012 at 06:05:34 UTC, Tongzhou Li wrote: Hello! I'm learning D, and wrote some sample codes with D. I wrote: http://ideone.com/VY7ES It failed to compile; I got 2 errors: main.d(19): Error: constructor main.carry!

Re: Problem about using struct

2012-06-25 Thread bearophile
Tongzhou Li: Don't know what it means, I don't call any constructor in Line 19. Then I tried to use "class" instead of "struct" (http://ideone.com/ZI2Tn), it worked fine. So what's wrong with that? At first sight your code seems OK. There is a well known compiler bug that makes it call the

Re: Problem about using struct

2012-06-25 Thread Kenji Hara
On Monday, 25 June 2012 at 06:05:34 UTC, Tongzhou Li wrote: Hello! I'm learning D, and wrote some sample codes with D. I wrote: http://ideone.com/VY7ES It failed to compile; I got 2 errors: main.d(19): Error: constructor main.carry!(int,int,int,int,int).carry.this (int delegate(int, int _p

Problem about using struct

2012-06-24 Thread Tongzhou Li
Hello! I'm learning D, and wrote some sample codes with D. I wrote: http://ideone.com/VY7ES It failed to compile; I got 2 errors: main.d(19): Error: constructor main.carry!(int,int,int,int,int).carry.this (int delegate(int, int _param_0, int _param_1, int _param_2) _f) is not callable usin