
Hello, I have an algorithm like: template <typename Upper, typename Lower> class X { static void f() { .... for (size_t n=0; n<=N; ++n) { // process for j=0 at every n if Lower::IsConstant is false for (size_t j=1; j<=J-1; ++j) { } // process for j=J at every n if Upper::IsConstant is false } .... } So I extracted the double for loop in a separate wrapper class and I verbosely wrote 4 specializations with template args begin bool : <true, true> <false, true> <true, false> <false, false> for e.g. for <true, true> // process for j=0 once for (size_t n=0; n<=N; ++n) { for (size_t j=1; j<=J-1; ++j) { } } // process for j=J once Any advice? Is there a better way than writing explicitly the tmpl specializations? Boost.PP maybe? rds,