Problem about using struct

bearophile bearophileHUGS at lycos.com
Mon Jun 25 03:10:55 PDT 2012


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 struct 
constructor instead of its opCall. I think there is already a 
pull request that fixes it in Bugzilla since some time (there are 
more than one hundred of those open).

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list