
Great. This works. -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Steven Watanabe Sent: 28 January 2008 22:39 To: boost-users@lists.boost.org Subject: Re: [Boost-users] Template instantiation function arguments and Boost.Preprocessor AMDG Ah. You still need the preprocessor, but you can rearrange the definitions slightly. (untested) template<int N> struct TreeSumImpl; #define TREE_SUM_DEF(z, n, data)\ template<>\ struct TreeSumImpl<n> {\ static double sum(BOOST_PP_ENUM_PARAMS_Z(z, n, double arg)) { ... }\ }; BOOST_PP_REPEAT(20, TREE_SUM_DEF, ~) template<int N> struct Tree : TreeSumImpl<N> { // other code }; In Christ, Steven Watanabe