48.函数模板与引用包装器

 1 #include <iostream>
 2 using namespace std;
 3 
 4 template <class T>
 5 void show(T t)
 6 {
 7     cout << t << endl;
 8     t += 10;
 9 }
10 
11 void main()
12 {
13     double db(1.0);
14     double &ldb(db);
15     //引用包装器,声明为一个引用
16     show(ref(ldb));
17     cout << db << endl;
18     cin.get();
19 }
原文地址:https://www.cnblogs.com/xiaochi/p/8552643.html