|
|
От: | Аноним | |
| Дата: | 17.07.03 10:58 | ||
| Оценка: | |||
#include <iostream>
using namespace std;
template<class T>
bool cmp(T a, T b)
{
cout << "General template function called" << endl;
return (a<b);
}
template<>
bool cmp<int*>(int* a, int* b)
{
cout << "Pointer template function called" << endl;
return (*a<*b);
}
void main()
{
int j=5, i=7;
cmp(i, j);
cmp(&i, &j);
}