#include #include #include namespace ki { template class property : boost::noncopyable { private: typedef boost::function GetterType; typedef boost::function SetterType; public: /* template property( G g ) : getterFunc( g ) { } template property( G g, S s ) : getterFunc( g ) , setterFunc( s ) { } */ template property( Owner p, G g ) : getterFunc( boost::bind( g, p ) ) { } template property( Owner p, G g, S s ) : getterFunc( boost::bind( g, p ) ) , setterFunc( boost::bind( s, p, _1 ) ) { } public: operator T() const { return getterFunc(); } property& operator=( const T& rhs ) { setterFunc( rhs ); return *this; } private: const GetterType getterFunc; const SetterType setterFunc; }; }