lambda capturing structured bindings

1k Views Asked by At

As my understanding C++17 don't forbid lambda expressions from capturing structured bindings. the below is accepted by gcc but rejected by clang, yet cppreference claim that lambdas can't capture structured bindings.

int arr[] {0, 1};
auto& [a, b] = arr;
auto foo = [&] { b = 9; }; // capturing structured bindings
  1. Is either clang or gcc non-conformant?

  2. Is cppreference wrong in tagging the behavior as part of C++17 ?

0

There are 0 best solutions below