数值交换模板函数

来源:互联网 发布:hex转换ascii编程 编辑:程序博客网 时间:2024/05/17 09:19
//交换数据template <typename type>void Swap(type * lhs, type * rhs); //lhs = left hand side; rhs = right hand sidetemplate <typename type>void Swap(type * lhs, type * rhs){    type temp = *lhs;    *lhs = *rhs;    *rhs = temp;}
0 0