D言語 Part22
■ このスレッドは過去ログ倉庫に格納されています
0498デフォルトの名無しさん
2009/08/08(土) 20:54:56class Test {
public void print() { writef("(this, &this):(%p, %p)\n", this, &this); }
void isSelf(Test a, Test b) {
writefln("this:a %b this:b %b a:b %b", this is a, this is b, a is b);
writefln("&this: %p &a: %p &b: %p\n", &this, &a, &b);
}
}
void main()
{
Test test = new Test, test2 = new Test;
writef("(test, &test):(%p, %p)\n", test, &test);
test.print();
test.isSelf(test, test2);
writef("(test2, &test2):(%p, %p)\n", test2, &test2);
test2.print();
test2.isSelf(test, test2);
}
■ このスレッドは過去ログ倉庫に格納されています