摘要: 16.53 编写你自己版本的print函数,并打印一个、两个及五个实参来测试它,要打印的每个实参都应有不同的类型。#include#includeusing namespace std;template ostream& print(ostream &os,const T &t){ osost... 阅读全文
posted @ 2014-09-01 22:59 Jessica程序猿 阅读(201) 评论(0) 推荐(0)
摘要: 16.47 编写你自己版本的翻转函数,通过调用接受左值和右值引用参数的函数来测试它。#include#include#includeusing namespace std;template int compare(const T &a ,const T &b){ if(aauto sum(T ... 阅读全文
posted @ 2014-09-01 20:49 Jessica程序猿 阅读(247) 评论(0) 推荐(0)
摘要: 16.21 编写你自己的DebugDelete版本。#include#includeusing namespace std;class DebugDelete{public: DebugDelete(ostream &s=cerr):os(s) {} template void ... 阅读全文
posted @ 2014-09-01 10:37 Jessica程序猿 阅读(259) 评论(0) 推荐(0)