I'm new to C++17 and I ran into a problem when I tried to use structure binding to set values to a couple of array cells. But the regular syntax doesn't work here; it gets confused with the array's brackets.
How can I solve it? Is it even possible?
Example:
std::pair<int, int> makePair() {
return { 10, 20 };
}
int main() {
int arr[20];
// error here
auto [arr[0], arr[1]] = makePair();
}