2017.06.07c++模板的学习

xiaoxiao2021-02-28  109

template <class T> void Swap(T &,T &); template <> void Swap<int>(int &,int &); template <> void Swap<char>(char &,char &); template <> void Swap<job>(job &,job &); //可以个性化定制本函数内容 int main() { int a,b; char c,d; job e,f; Swap(a,b); Swap(c,d); Swap(e,f); }
转载请注明原文地址: https://www.6miu.com/read-62923.html

最新回复(0)