I'm looking for a way to write certain kinds of classes without duplication or unnecessary verbosity. Because there will be many of them in a single file and I want them to be readable. I'm trying to decide if I should use the preprocessor or if I should write a script to do the translation before compilation. 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; }; Is such a thing possible? You see, there are a few things happening there: * Variable length list, reproduced more than once in different ways. * Foo is remembered to use in the constructor name. What would the original code look like if we could make this work? And is there something in the boost preprocessor library that can help me? Thanks in advance! -- Michiel Helvensteijn