C++相談室 part13
■ このスレッドは過去ログ倉庫に格納されています
0657デフォルトの名無しさん
NGNG// property.h
template<class T, class O, T O::*M>
class property {
O &obj;
public:
property(O &o) : obj(o) {}
property& operator=(const T& x) {obj.*M = x; return *this;}
operator const T&() const {return obj.*M;}
operator T&() {return obj.*M;}
};
■ このスレッドは過去ログ倉庫に格納されています