One more about mixins
Tomasz Sowiñski
tomeksowi at gmail.com
Sun Aug 24 17:25:19 PDT 2008
BCS Wrote:
> using CTFE (compile time function evaluation) with arrays is "finicky"
so I noticed:)
> To limit the problem to the CTFE issues switch to this:
>
> pragma(msg, intGen("aa", "bb", "cc"));
>
> Post the error messages from that if you can't figure them out.
It says intGen("aa", "bb", "cc") can't be evaluated at compile time... I don't see why, all of its arguments are known at compile time and the function doesn't refer to anything outside its body...
test.d(13): Error: cannot evaluate intGen(cast(invariant(char)[][])((invariant(char)[][3u] __arrayArg286 = void;
) , (__arrayArg286[0u]) = "aa" , (__arrayArg286[1u]) = "bb" , (__arrayArg286[2u]) = "cc" , __arrayArg286)) at compile time
test.d(13): Error: string expected for message, not 'intGen(cast(invariant(char)[][])((invariant(char)[][3u] __arrayArg286 = void;
) , (__arrayArg286[0u]) = "aa" , (__arrayArg286[1u]) = "bb" , (__arrayArg286[2u]) = "cc" , __arrayArg286))'
line 13 contains the pragma, of course.
Tomek
More information about the Digitalmars-d-learn
mailing list