#include<iostream>
using std::cout;
using std::endl;
/*
* 模板特化
*/
template<typename T>
class c
{
public:
size_t operator()(const T& t) { return t; };
};
/*
* 这就是语法,因为T已经绑定了, 所以<>里面没内容了,这么理解很赞;
*/
template<>
class c<int>
{
public:
size_t operator()(const int& i) { return i; }
};
/*
* 模板偏特化;
*/
template<typename T1, typename T2, typename T3>
class d
{
public:
size_t operator()(const T1& t1, const T2& t2, const T3& t3) { return 0;};
};
template<typename T2, typename T3>
class d<int, T2, T3>
{
public:
size_t operator()(const int& t1, const T2& t2, const T3& t3) { return 0;};
};
template<typename T1, typename T3>
class d<T1, int, T3>
{
public:
size_t operator()(const T1& t1, const int& t2, const T3& t3) { return 0;};
};
/*
* 模板偏特化:指针;
* e针对T为T*的类型进行偏特化
*/
template <typename T>
class e
{
};
template <typename U>
class e<U*>
{
};
int main(int argc, char* argv[])
{
}