compile-time function in a class?

Alexander Panek a.panek at brainsware.org
Tue Mar 20 12:01:57 PDT 2007


Davidl wrote:
> class test
> {
>     static char[] c(){return "a";}
>     int a;
>     class b
>     {
>         mixin(c());
>     }
> }
> void main()
> {
> 
> }
> 
> don't u think my example should compile?
> 
> i don't violate any thing from evaluating func c from compile-time

AFAIK, to be able to mixin a function, it has to be either inside a 
template, a templated struct, a templated class or just be a template 
function.



More information about the Digitalmars-d mailing list