On 12 July 2010 06:25, Frank Winter <frank.winter@xxxxxxx> wrote: > Thanks for your reply! > > Your provided code doesn't seem to work: > It seems I out-clevered myself and ran into some nasty syntax corners. Here's a fixed version: template <unsigned I> struct repeater { template <typename F> repeater(F f) { f(); (repeater<I-1>)(f); } }; template <> struct repeater<0> { template <typename F> repeater(F) {} }; void bar() { std::cout << "Yay!\n"; } int main() { (repeater<4>)(bar); } Oh, the wonders of C++ grammar... ~ Scott