用gcc 5.2和3.7鏗鏘下面的作品,但失敗MSVC 2015年:MSVC的std ::功能無法嵌套拉姆達接受通用拉姆達
#include <functional>
int main()
{
auto const foo = [](auto&& i) {
auto const bar = []{ return 100; };
return bar();
};
std::function<int(int)> fn = foo;
return 0;
}
難道是MSVC的錯誤或者是gcc和鏗鏘過於鬆懈?
Visual Studio中的哪個版本? –
vs2015 –
Nubcase
如果將其更改爲'auto const foo = [](auto && i) - > int {' – melak47