On Sun, 2009-01-04 at 22:53 +0100, Michiel Helvensteijn wrote:
I would like something like this (how I think it might look):
CLASS(Foo, FROM(Bar)) CONSTRUCT() CONSTRUCT(PAR(int, a, A), PAR(bool, b, B)) int A; bool B; END_CLASS
to automatically become something like this:
class Foo : public Bar, public shared_from_this<Foo> { private: Foo() {} public: static shared_ptr<Foo> construct() { return shared_ptr<Foo>(new Foo()); } private: Foo(int a, bool b) : A(a), B(b) {} public: static shared_ptr<Foo> construct(int a, bool b) { return shared_ptr<Foo>(new Foo(a, b)); } int A; bool B; };
Have you considered how boost::tuple might help ?
A boost::tuple