C++相談室 part13
■ このスレッドは過去ログ倉庫に格納されています
0658デフォルトの名無しさん
NGNG#include <iostream>
#include "property.h"
class foo
{
int a;
public:
property<int, foo, &foo::a> x;
foo() : a(0), x(*this) {};
friend ostream& operator<<(ostream &os, const foo &f) {
return os << "foo<" << f.x << ">";
}
};
int main()
{
foo f;
cout << f << endl;
f.x = 10;
cout << f << endl;
}
■ このスレッドは過去ログ倉庫に格納されています