模板特殊化的格式的问题
#include <iostream>
using namespace std;
// Template specialization
template <class T> class Pair {
T value1, value2;
public:
Pair (T first, T second){
value1=first;
value2=second;
}
T show () {return 0;}
};
template <>
class Pair <int> {
int value1, value2;
public:
Pair (int first, int second){
value1=first;
value2=second;
}
int show ();
};
template <>
int Pair<int>::show()
{
return value1%value2;
}
int main () {
Pair <int> myints (100,75);
Pair <float> myfloats (100.0,75.0);
cout << myints.show() << '\n';
cout << myfloats.show() << '\n';
return 0;
}