This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47226] [C++0x] GCC doesn't expand template parameter pack that appears in a lambda-expression
- From: "kretz at kde dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 06 Jul 2017 12:25:48 +0000
- Subject: [Bug c++/47226] [C++0x] GCC doesn't expand template parameter pack that appears in a lambda-expression
- Auto-submitted: auto-generated
- References: <bug-47226-4@http.gcc.gnu.org/bugzilla/>
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)...};