#include <boost/preprocessor/repetition/enum_trailing_params.hpp> #include <boost/preprocessor/repetition/repeat.hpp> #define MACRO(z, n, _) \ template< \ class BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, class T) \ > class X ## n { \ /* ... */ \ }; \ /**/ BOOST_PP_REPEAT(2, MACRO, nil) /* expands to... template<class> class X0 { }; template<class, class T0> class X1 { }; */
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at www.boost.org/LICENSE_1_0.txt)