template <typename T>//显式具体化
template<> void foo1<int>(int& a,int &b)
{
}
template <typename T>//显式实例化
template void foo2<int>(int& a, int &b)
{
}
template <typename T>//模板
void foo3(T &C, T &D)
{
}
template <typename T, typename X >//模板,隐式实例化重载
void foo4(T &C, X &D)
{
template<> void foo1<int>(int& a,int &b)
{
}
template <typename T>//显式实例化
template void foo2<int>(int& a, int &b)
{
}
template <typename T>//模板
void foo3(T &C, T &D)
{
}
template <typename T, typename X >//模板,隐式实例化重载
void foo4(T &C, X &D)
{
}
非模板函数“优先级”高于模板函数,显式具体化高于模板;
使用array必须使用同名头文件,存在于名字空间std 中
格式:std::array<type,num> id //(使用type的类型创造num大小的数组,数组名为id)于vector不同,array定长,不允许改变