The following snippet will compile in GCC 8+, but fails to compile in GCC 7.
template <typename... THINGS>
struct A
{
explicit A(THINGS *... things)
{
(..., [thing = things](){}());
}
};
int main()
{
int thing;
const auto thingy = A{&thing};
}
The stated failure is that the parameter pack isn't being expanded: parameter packs not expanded with '...'
.
Checking the GCC standards compliance page, fold expressions should be supported in GCC 7.
Is there another flag i need besides std=c++17
? (i didn't see one)
Is the standard not yet completely implemented? (i didn't see anything indicating that)
Can i make this work, or is this just a GCC 7 bug i'm going to have to work around?