#include #include template< class fixup > void f( int &i, fixup r1, fixup r2 ); template< class fixup > void g( int &i, fixup r1, fixup r2 ); template< class fixup > void h1( int &i, fixup r1, fixup r2 ) { i -= 1; uCout << "h1, i:" << i << endl; f( i, r1, r2 ); } template< class fixup > void h2( int &i, fixup r1, fixup r2 ) { i -= 2; uCout << "h2, i:" << i << endl; g( i, r1, r2 ); } template< class fixup > void f( int &i, fixup r1, fixup r2 ) { i -= 1; uCout << "f, i:" << i << endl; if ( i > 0 ) { if ( i % 2 != 0 ) r2(i, r1, r2); g( i, r1, r2 ); } } template< class fixup > void g( int &i, fixup r1, fixup r2 ) { i -= 1; uCout << "g, i:" << i << endl; if ( i > 0 ) { f( i ); r1(i, r1, r2); } } void uMain::main() { int i = 20; f( i, h1, h2 ); }