What about:
CLASS(Foo, FROM(Bar), CONSTRUCT(BOOST_PP_EMPTY_SEQ) CONSTRUCT((int, a, A)(bool, b, B)) int A; bool B; )
Might that not be a way to avoid the Foo repetition?
It would have to look like CLASS( Foo, FROM(Bar) , CONSTRUCT( BOOST_PP_EMPTY_SEQ ) CONSTRUCT( (int, a, A)(bool, b, B) ) , int A ; bool B ; ) where you have #define CONSTRUCT(sequence) sequence and the CLASS macro does all the work. The macro implementation would be slightly more complicated because of the nested FOR_EACHs (degrading maintainability) and debuggability will be impaired, but perhaps still better than introducing an external code generator to your build setup. Nb it seems like the 'a' and 'b' are superfluous - the constructor parameters could be written something like BOOST_PP_CAT(membervarname , _ ).