Consider the following code that uses structured bindings from C++17:
int a = 0, b = 0;
auto [x, y] = std::tie(a, b);
y = 1;
std::cout << a << ' ' << b << '\n';
Since I used auto
, I would expect the code to print 0 0
as y
should be a copy. However, it prints 0 1
. Why? I thought that a bare auto
never deduces a reference.