C2065 'a': undeclared identifier
(使用visual studio 2017):
[] {
auto [a, b] = [] {return std::make_tuple(1, 2); }();
auto r = [&] {return a; }(); //error C2065
}();
[] {
int a, b;
std::tie(a, b) = [] {return std::make_tuple(1, 2); }();
auto r = [&] {return a; }();
}();
我认为这两个样品是相等的。是编译器错误还是我遗漏了什么?