#include <iostream>
using namespace std; template<class T>
class PrintMe {
public:
void operator()(const T & t)
{
cout << t << " ";
}
};int main()
{
//We'll create a function that works like the old C printf() fucntion
PrintMe<int> PrintThis;
for(int i = 0; i < 5; ++i)
PrintThis(i);
return 0;
} |