...ing logging 4.0

はてなブログに移行しました。D言語の話とかいろいろ。

2010-01-31から1日間の記事一覧

shared static this モジュールコンストラクタ - dmd2.040

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…

@disable - dmd2.040

Add @disable attribute import std.stdio; struct A { @disable this(this) {} // コピー禁止 } void main() { A a, b; a = b; // error } C++ではコピー禁止にするためにコピーコンストラクタやoperator=をprivateメンバにする方法がありましたが,D言語で…

interfaceにstatic/finalメンバ関数 - dmd 2.040

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の間にそのためのク…