On 08/16/09 09:32, Larry Evans wrote: > On 12/07/07 15:12, Rene Buergel wrote: >> I'm currently playing around using mainline with the variadic template >> feature and would like to hear some comments on code gcc is rejecting. >> >> #1: >> ===== >> 1 template T max() >> 2 { >> 3 return a > max() ? a : max(); >> 4 }; >> 5 >> 6 templateT max() >> 7 { >> 8 return a > b ? a : b; >> 9 }; >> >> int main() >> { >> unsigned int a = max(); >> unsigned int a = max(); >> } >> >> ===== >> Using the non-variadic template, everything works fine. With the >> variadic templates, gcc issues an error in line 3: >> error: parameter packs not expanded with `...': >> note: 'Args' > [snip] > I think this is an instance of bug 40092: [snip] OOPS. It's unrealted to bug 40092. Part of the problem is Args needs to be expanded as follows: Args... I think *maybe* the other problem is template function specialization. Anyway, the workaround is to use template class specializations as shown in the attached. HTH. -Larry