标签:
#include <functional> int main() { std::function<int()> fn[100]; for( int i = 0; i < 100;i++ ) fn[i] = [=]() {return i; }; for( int i = 0; i < 100; i++ ) printf( "%d\n", fn[i]() ); return 0; } //result: //0~99 1: std::function<int()> fn[100] 等于缩写了下面的: typedef int (*TypeFn)(); TypeFn fn[100];
标签:
原文地址:http://www.cnblogs.com/codetask/p/5602194.html