variable x cannot be read at compile time (ctfe)

bearophile bearophileHUGS at lycos.com
Mon Dec 17 06:42:51 PST 2012


maarten van damme:

> Here is a trimmed down version : http://dpaste.dzfl.pl/11170641
>
> thanks for the quick reply.

It seems to work if you move ".array()" from 
generateBitsetCache() to bitsetToRange(). I think it's a problem 
of nested delegates at CT. But if this is the problem, dmd used 
to give a more clear error message.


> both cache~=bitsetToRange(x).array();
> MaxArray!(int, boardSide) temp=bitsetToRange(x).array();
> fail ...

I think you need to define more operators in MaxArray to allow 
some of that.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list