
"Jonathan Turkanis" wrote:
I believe the attached file does what Pavel has in mind. Let someone
else
check it, though, since I'm not preprocessor expert.
One last try ... the version I just posted had the include guards out of order.
The technique used here is called file iteration. It works well. It is the most powerful mechanism in PP. The local iteration approach is bit simpler and would look like: ------------- #define BOOST_PP_LOCAL_MACRO( n ) \ template < BOOST_PP_ENUM_PARAMS(n, typename T) > \ explicit base_from_member( BOOST_PP_ENUM_BINARY_PARAMS(n, T, x) ) \ : member( BOOST_PP_ENUM_PARAMS(n, x) ) \ {} \ /**/ #define BOOST_PP_LOCAL_LIMITS (1, BOOST_BASE_FROM_MEMBER_MAX_ARITY) #include BOOST_PP_LOCAL_ITERATE() ------------- I think file iteration makes no harm. /Pavel