41:
头文件
#ifndef REU_TYPE_H
#define REU_TYPE_H
template <typename T> auto sum(const T&a,const T&b) ->decltype(a+b)//将函数的返回类型指定为a+b的类型
{
return a+b;
}
#endif REU_TYPE_H
main.cpp
#include <iostream>
#include <vector>
#include <list>
#include <string>
#include "Reu_type.h"
using namespace std;
int main(int argc,char** argv)
{
int a = 566669;
int b = 595955;
cout<<sum(a,b);
cin.get();
re