阅读背景:

在lambda函数中使用auto

来源:互联网 
#include <vector>
#include <algorithm>

void foo( int )
{
}

int main()
{
  std::vector< int > v( { 1,2,3 } );

  std::for_each( v.begin(), v.end(), []( auto it ) { foo( it+5 ); } );
}
#include <vector>
#include <algorithm>

void fo



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: