这有效...
auto x = 4;
typedef decltype(x) x_t;
x_t y = 5;
……那为什么不呢?
int j = 4;
auto func = [&] (int i) { cout << "Hello: i=" << i << " j=" << j << endl;};
typedef decltype(func) lambda_t;
lambda_t func2 = [&] (int i) { cout << "Bye: i=" << i << " j=" << j << endl;};
...以及如何lambda_t
使用 std::function 手动声明?