[Bug c++/47226] [C++0x] GCC doesn't expand template parameter pack that appears in a lambda-expression
kretz at kde dot org
gcc-bugzilla@gcc.gnu.org
Thu Jul 6 12:26:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47226
Matthias Kretz <kretz at kde dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kretz at kde dot org
--- Comment #10 from Matthias Kretz <kretz at kde dot org> ---
I have the following in my code now:
// this could be much simpler:
//
// return {V([&](auto i) { return x[i + Indexes * V::size()]; })...};
//
// Sadly GCC has a bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47226.
The
// following works around it by placing the pack outside of the code block
of the
// lambda:
return {[](size_t j, const datapar<T, A> &y) {
return V([&](auto i) { return y[i + j * V::size()]; });
}(Indexes, x)...};
More information about the Gcc-bugs
mailing list