...ing logging 4.0

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

2009-07-28から1日間の記事一覧

dcharの世界へ

const(char*) toMBSz(in wchar[] t) { return toMBSz(to!string(t)); } const(char*) toMBSz(in dchar[] t) { return toMBSz(to!string(t)); } alias std.windows.charset.toMBSz toMBSz; void p(T)(T t) { printf("%s\n", toMBSz(to!string(t))); } しかしW…

わたし「まだあなたのことよくわかってないの・・・ごめんなさい」shared_ptr「・・・」

import std.stdio; struct shared_ptr(T) if (is(T == class)) { uint n; T p; alias p this; this(T p) { n++; this.p = p; writeln("construct, ", n); } this(this) { n++; writeln("reference copy, ", n); } ~this() { n--; if (n==0) { delete p; writ…