2010-01-31から1日間の記事一覧
Added shared static constructors/destructors, regular static constructors/destructors now deal with TLS import std.stdio; import core.thread; class X { int v; } static X a; static this() { a = new X; a.v = 1; } shared static X b; shared st…
Add @disable attribute import std.stdio; struct A { @disable this(this) {} // コピー禁止 } void main() { A a, b; a = b; // error } C++ではコピー禁止にするためにコピーコンストラクタやoperator=をprivateメンバにする方法がありましたが,D言語で…
added static/final function implementations to interfaces import std.stdio; interface I { static int f() { return 1; } } class A : I {} void main() { I i = new A; writeln(i.f()); } staticメンバー関数を配置するために,IとAの間にそのためのク…