https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103313

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note this code was not valid as there is no way to deduce the template
arguments based on the default argument.

What you can do instead is do this (for C++20 though):
```
template <int I>
struct S {
    Q mq[I];
    void f(array<int, I> &a) {
      [&]<size_t ...num>(index_sequence<num...>) {
        ((mq[num].set(a[num])), ...);
      }(make_index_sequence<I>{});
    }
};
```

That is make an templated lambda to take the index_sequence to do the fold
expression.

Reply via email to