#include #include using namespace std; //Output the integers from 1 to LAST inclusive. LAST must be non-negative. //count is a template function consisting of the general-purpose template //in line 10 and the explicit specialization in line 17. template inline void count() { count(); cout << LAST << "\n"; } template <> inline void count<0>() {} int main() { count<4>(); //4 lines of output count<0>(); //no output //count<-1>(); //won't compile: "instantiation depth exceeds maximum" return EXIT_SUCCESS; }