d中的package,private

import std.stdio;

struct C {
    private int x;//模块范围内私有
}//-betterC中构不能继承
//包(..模块.),单独暴露,(模块及子模块)可访问
//包,同一包中模块可访问

void main() {
    //C c = new C();//这样是不能用于-betterC的
    C c;c.x = 10;
    writeln(c.x);
}

我明显感觉csdnmd编辑器变差了.
的目的就是编译时执行,

posted @ 2020-01-18 14:32  zjh6  阅读(15)  评论(0)    收藏  举报  来源