d语言编译时值参与静如

import core.stdc.stdio;
extern(C):
struct A(int I){
    int i;
    static if(I==4)
    void f(){
        printf("kk");
    }
}
void main()
{
    A!4 t;
    t.f();
}

d的编译时值参数static if.

posted @ 2021-11-12 20:40  zjh6  阅读(16)  评论(0)    收藏  举报  来源