auto
double
a=3.7;
x=5.2;
//这里的x被auto推断为double类型
map<
int
,
>m;
for
(
it=m.begin();
//这里it被auto推断为map<int,int>::iterator类型
it!=m.end();++it)
{
//....
}
C/C++中的auto关键词
原文:http://www.cnblogs.com/vanishfan/p/6736834.html