/*****************************************************************
Name :
Date : 2017/04/04
By : CharlotteHonG
Final: 2017/04/04
*****************************************************************/
#include <iostream>
using namespace std;
template<class T, class T2>
auto fun1(T a, T2 b) -> decltype(a+b){
return a+b;
}
template<class T, class T2>
auto fun2(T a, T2 b){
return a+b;
}
template<class T, class T2>
decltype(auto) fun3(T a, T2 b){
return a+b;
}
/*==============================================================*/
int main(int argc, char const *argv[]){
cout << "fun=" << fun1(1, 1.5) << endl;
cout << "fun=" << fun2(1, 1.5) << endl;
cout << "fun=" << fun3(1, 1.5) << endl;
return 0;
}
/*==============================================================*/
LyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCk5hbWUgOiAKRGF0ZSA6IDIwMTcvMDQvMDQKQnkgICA6IENoYXJsb3R0ZUhvbkcKRmluYWw6IDIwMTcvMDQvMDQKKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiNpbmNsdWRlIDxpb3N0cmVhbT4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnRlbXBsYXRlPGNsYXNzIFQsIGNsYXNzIFQyPgphdXRvIGZ1bjEoVCBhLCAgVDIgYikgLT4gZGVjbHR5cGUoYStiKXsKICAgIHJldHVybiBhK2I7Cn0KCnRlbXBsYXRlPGNsYXNzIFQsIGNsYXNzIFQyPgphdXRvIGZ1bjIoVCBhLCAgVDIgYil7CiAgICByZXR1cm4gYStiOwp9Cgp0ZW1wbGF0ZTxjbGFzcyBULCBjbGFzcyBUMj4KZGVjbHR5cGUoYXV0bykgZnVuMyhUIGEsICBUMiBiKXsKICAgIHJldHVybiBhK2I7Cn0KCgovKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KaW50IG1haW4oaW50IGFyZ2MsIGNoYXIgY29uc3QgKmFyZ3ZbXSl7CiAgICBjb3V0IDw8ICJmdW49IiA8PCBmdW4xKDEsIDEuNSkgPDwgZW5kbDsKICAgIGNvdXQgPDwgImZ1bj0iIDw8IGZ1bjIoMSwgMS41KSA8PCBlbmRsOwogICAgY291dCA8PCAiZnVuPSIgPDwgZnVuMygxLCAxLjUpIDw8IGVuZGw7CgogICAgcmV0dXJuIDA7Cn0KLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSov