
Jonathan Turkanis schrieb:
Stefan Strasser wrote:
Hi,
I'd like to know if there is interest in developing a small library for inclusion in boost to emulate properties, something like:
struct A{ void SetVar(int a){ cerr << "set " << a << endl; } int GetVar() const{ cerr << "get" << endl; return 0; } BOOST_PROPERTY(A,int,Var,SetVar,GetVar); };
A a; a.Var=3; //calls SetVar
You might like to look at this thread: http://lists.boost.org/MailArchives/boost/msg74302.php
thanks! though I think an implementation like the one described in N1615 is impractical to use, because, besides the overhead of the implementation pointer, you need to explicitly construct each property. which isn't required, with the drawback of using a macro to declare properties. however, where can you find it? it isn't in the sandbox anymore. -- Stefan Strasser