// template recursion // This is from the draft standard and soome articles in trade papers // However Gnu CC 2.7.0 template int fac() { return i>1 ? i*fac() : 1; } int fac<0>() { return 1; } #include int main() { cout<< fac<0>(); cout<< fac<7>(); } /* trex.cc:7: parse error before `<' trex.cc: In function `int main()': trex.cc:13: cannot resolve overloaded function `fac' based on non-function type trex.cc:13: no match for `operator <<(class _IO_ostream_withassign, {unknown typ e})' trex.cc:13: parse error before `(' trex.cc:14: cannot resolve overloaded function `fac' based on non-function type trex.cc:14: no match for `operator <<(class _IO_ostream_withassign, {unknown typ e})' trex.cc:14: parse error before `(' */