Problem about using struct

Tongzhou Li zhangsongcui at hotmail.com
Sun Jun 24 23:05:32 PDT 2012


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 
using argument types (int)
     main.d(19): Error: cannot implicitly convert expression (1) 
of type int to int delegate(int, int _param_0, int _param_1, int 
_param_2)
Compiler used: DMD v2.059 (I used lambda expression which ideone 
doesn't support)

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?
Sorry for my poor English:)


More information about the Digitalmars-d-learn mailing list