序曲:
std::tuple<int, int, int> f();
std::tuple<int, int, float, int> g();
C + + 1z 将为结构化绑定引入语法,这将使编写代替
int a, b, c;
std::tie(a, b, c) = f();
比如
auto [a, b, c] = f();
但是,std::tie
也允许指定 std::ignore
来忽略某些组件,例如:
std::tie(a, b, std::ignore, c) = g();
Will it be possible to do something similar using the new structured bindings syntax? How would it work?