template <class T> ostream& operator<<(ostream& stream_out,const rat<T> &rvalue) {
stream_out << "Rational number: " << rvalue.ch << "/" << rvalue.zn << endl;
return stream_out;
}
template <class T>
void f (T x /*from*/, unsigned N, T step = T(1))
{
for (unsigned i= 1; i <= N; x = x+step, ++i)
{ cout << x; if (i< N) cout << " ,"; }
cout << endl;
}
f<int>(0, 3);
f<double>(0, 4, 0.5);
0, 1, 2
0, 0.5, 1, 1.5