/*
* c++11关键字
* auto
* 未完待续
* 小鱼号的代码日志
*/
#include <QCoreApplication>
#include <iostream>
#include <typeinfo>
using namespace std;
float add(int a,float b)
{
return a+b;
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
auto v = 1 + 2;
cout << " type of v " << typeid(v).name() << "\n";
auto b = add(11,125.51);
cout << " type of b " << typeid(b).name() << "\n";
auto c = {1,2};
cout << " type of c " << typeid(c).name() << "\n";
auto myLambda = [](int x) {return x+3;};
cout << " type of myLambda " << typeid(myLambda).name() << "\n";
return a.exec();
}
网友评论