在偏特化和特化上我学的并不好,傻傻分不清目前,也没搞懂这个的目的是什么…
#include<iostream>
using namespace std;
template<class key>
struct _hash{};
template<>
struct _hash<int> {
size_t operator()(int sit) {
cout << "hash<int>:";
return sit;
}
};
template<>
struct _hash<double> {
size_t operator()(int sit) {
cout << "hash<double>:";
return sit;
}
};
int main(void) {
_hash<double>()(100); cout << endl;
cout << __cplusplus;
system("pause");
return 0;
}