d字符串,不在运行时,但可在编译时.

int foo(string s1, string s2)()
{
    __totype(s1) x = 4;
    mixin(s2) y = 3;
    return x + y;
}

enum i = foo!("i", "int")();
posted @ 2021-01-27 21:24  zjh6  阅读(16)  评论(0)    收藏  举报  来源